Changes between Version 26 and Version 27 of AppMultiThread
- Timestamp:
- Dec 18, 2009, 8:53:42 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AppMultiThread
v26 v27 17 17 18 18 You should set the priority of new threads to that of the main thread. 19 {{{ 20 #ifdef MSVC 21 #define getThreadPriority() GetThreadPriority(GetCurrentThread()) 22 #define setThreadPriority(num) SetThreadPriority(GetCurrentThread(), 23 num) 24 #else 25 #include <sys/resource.h> 26 #define getThreadPriority() getpriority(PRIO_PROCESS, 0) 27 #define setThreadPriority(num) nice(num) 28 #endif 29 }}} 30 getThreadPriority() is called before forking (by OpenMP in AQUA's case), 31 and setThreadPriority() is then called by each worker thread. 19 32 20 33 == Deploying a multi-threaded app version ==