mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
multithread: doc improvements
This commit is contained in:
10
README.adoc
10
README.adoc
@@ -10579,7 +10579,7 @@ cat /proc/cpuinfo
|
|||||||
getconf _NPROCESSORS_CONF
|
getconf _NPROCESSORS_CONF
|
||||||
....
|
....
|
||||||
|
|
||||||
====== Number of cores in QEMU user mode
|
====== QEMU user mode multithreading
|
||||||
|
|
||||||
TODO why in <<user-mode-simulation>> QEMU always shows the number of cores of the host. E.g., both of the following output the same as `nproc` on the host:
|
TODO why in <<user-mode-simulation>> QEMU always shows the number of cores of the host. E.g., both of the following output the same as `nproc` on the host:
|
||||||
|
|
||||||
@@ -10602,9 +10602,9 @@ Remember <<qemu-user-mode-does-not-show-stdout-immediately>> though.
|
|||||||
|
|
||||||
At 369a47fc6e5c2f4a7f911c1c058b6088f8824463 + 1 QEMU appears to spawn 3 host threads plus one for every new guest thread created. Remember that link:userland/posix/pthread_count.c[] spawns N + 1 total threads if you count the `main` thread.
|
At 369a47fc6e5c2f4a7f911c1c058b6088f8824463 + 1 QEMU appears to spawn 3 host threads plus one for every new guest thread created. Remember that link:userland/posix/pthread_count.c[] spawns N + 1 total threads if you count the `main` thread.
|
||||||
|
|
||||||
====== Number of cores in gem5 user mode
|
====== gem5 syscall emulation multithreading
|
||||||
|
|
||||||
gem5 user mode multi core has been particularly flaky compared <<number-of-cores-in-qemu-user-mode,to QEMU's>>.
|
gem5 user mode multithreading has been particularly flaky compared <<qemu-user-mode-multithreading,to QEMU's>>.
|
||||||
|
|
||||||
You have the limitation that you must have at least one core per guest thread, otherwise `pthread_create` fails. For example:
|
You have the limitation that you must have at least one core per guest thread, otherwise `pthread_create` fails. For example:
|
||||||
|
|
||||||
@@ -13110,8 +13110,8 @@ The following sections are related to multithreading in userland:
|
|||||||
** <<x86-thread-synchronization-primitives>>
|
** <<x86-thread-synchronization-primitives>>
|
||||||
** <<arm-lse>>
|
** <<arm-lse>>
|
||||||
* emulator topics:
|
* emulator topics:
|
||||||
** <<number-of-cores-in-qemu-user-mode>>
|
** <<qemu-user-mode-multithreading>>
|
||||||
** <<number-of-cores-in-gem5-user-mode>>
|
** <<gem5-syscall-emulation-multithreading>>
|
||||||
|
|
||||||
=== C debugging
|
=== C debugging
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,16 @@
|
|||||||
*
|
*
|
||||||
* https://cirosantilli.com/linux-kernel-module-cheat#pthreads
|
* https://cirosantilli.com/linux-kernel-module-cheat#pthreads
|
||||||
*
|
*
|
||||||
|
* Usage:
|
||||||
|
*
|
||||||
|
* ....
|
||||||
|
* ./pthread_self.out [nthreads]
|
||||||
|
* ....
|
||||||
|
*
|
||||||
* Sample usage:
|
* Sample usage:
|
||||||
*
|
*
|
||||||
* ....
|
* ....
|
||||||
* ./pthread_tid.out 4
|
* ./pthread_self.out [nthreads]
|
||||||
* ....
|
* ....
|
||||||
*
|
*
|
||||||
* Sample output:
|
* Sample output:
|
||||||
|
|||||||
Reference in New Issue
Block a user