multithread: doc improvements

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-09-11 00:00:00 +00:00
parent 6aa375df2a
commit 6c599534db
2 changed files with 12 additions and 6 deletions

View File

@@ -10579,7 +10579,7 @@ cat /proc/cpuinfo
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:
@@ -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.
====== 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:
@@ -13110,8 +13110,8 @@ The following sections are related to multithreading in userland:
** <<x86-thread-synchronization-primitives>>
** <<arm-lse>>
* emulator topics:
** <<number-of-cores-in-qemu-user-mode>>
** <<number-of-cores-in-gem5-user-mode>>
** <<qemu-user-mode-multithreading>>
** <<gem5-syscall-emulation-multithreading>>
=== C debugging

View File

@@ -3,10 +3,16 @@
*
* https://cirosantilli.com/linux-kernel-module-cheat#pthreads
*
* Usage:
*
* ....
* ./pthread_self.out [nthreads]
* ....
*
* Sample usage:
*
* ....
* ./pthread_tid.out 4
* ./pthread_self.out [nthreads]
* ....
*
* Sample output: