[mpich] MPICH primary repository branch, master, updated. v3.2b3-196-ga849468
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "MPICH primary repository". The branch, master has been updated via a849468b5efbf1e0ea4bd82e1fad86c0d9326a43 (commit) from 6a5ec946e12304fe662b1ef8414557c2182b5b11 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.mpich.org/mpich.git/commitdiff/a849468b5efbf1e0ea4bd82e1fad86c0d9... commit a849468b5efbf1e0ea4bd82e1fad86c0d9326a43 Author: Halim Amer <[email protected]> Date: Wed Jul 8 18:47:52 2015 -0500 Advise against using sleeping routines to implement the yield functionality Details are given in the added comment. Signed-off-by: Xin Zhao <[email protected]> diff --git a/src/util/wrappers/mpiu_process_wrappers.h b/src/util/wrappers/mpiu_process_wrappers.h index 7675c1b..8ec43ee 100644 --- a/src/util/wrappers/mpiu_process_wrappers.h +++ b/src/util/wrappers/mpiu_process_wrappers.h @@ -9,6 +9,16 @@ #include "mpichconf.h" /* MPIU_PW_SCHED_YIELD() - Yield the processor to OS scheduler */ +/* On a typical Linux system (verified with kernels 3.2 and 3.5), + * usleep has a resolution of more than 1000 cycles. This makes + * it impractical if the desired sleeping period is shorter. On + * the other hand, sleep(0) returns immediately without going to + * the kernel. This means that there is no actual yielding, which + * is equivalent to doing nothing. Thus, usleep and sleep are not + * recommended as ways to yield the CPU, and sched_yield would be + * preferred if available. + * Note that nanosleep has the same shortcomings as usleep.*/ + #if defined(USE_SWITCHTOTHREAD_FOR_YIELD) #include <winsock2.h> #include <windows.h> ----------------------------------------------------------------------- Summary of changes: src/util/wrappers/mpiu_process_wrappers.h | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) hooks/post-receive -- MPICH primary repository
participants (1)
-
noreply@mpich.org