home *** CD-ROM | disk | FTP | other *** search
/ Game Programming - All in One (3rd Edition) / game_prog_all_in_one_3rd_ed.iso / pthread / docs / NEWS < prev    next >
Encoding:
Text File  |  2003-09-18  |  19.0 KB  |  534 lines

  1. SNAPSHOT 2003-09-18
  2. -------------------
  3.  
  4. Cleanup of thread priority management. In particular, setting of thread
  5. priority now attempts to map invalid Win32 values within the range returned
  6. by sched_get_priority_min/max() to useful values. See README.NONPORTABLE
  7. under "Thread priority".
  8.  
  9. Bug fixes
  10. ---------
  11. * pthread_getschedparam() now returns the priority given by the most recent
  12. call to pthread_setschedparam() or established by pthread_create(), as
  13. required by the standard. Previously, pthread_getschedparam() incorrectly
  14. returned the running thread priority at the time of the call, which may have
  15. been adjusted or temporarily promoted/demoted.
  16.  
  17. * sched_get_priority_min() and sched_get_priority_max() now return -1 on error
  18. and set errno. Previously, they incorrectly returned the error value directly.
  19.  
  20.  
  21. SNAPSHOT 2003-09-04
  22. -------------------
  23.  
  24. Bug fixes
  25. ---------
  26. * ptw32_cancelableWait() now allows cancelation of waiting implicit POSIX
  27. threads.
  28.  
  29. New test
  30. --------
  31. * cancel8.c tests cancelation of Win32 threads waiting at a POSIX cancelation
  32. point.
  33.  
  34.  
  35. SNAPSHOT 2003-09-03
  36. -------------------
  37.  
  38. Bug fixes
  39. ---------
  40. * pthread_self() would free the newly created implicit POSIX thread handle if
  41. DuplicateHandle failed instead of recycle it (very unlikely).
  42.  
  43. * pthread_exit() was neither freeing nor recycling the POSIX thread struct
  44. for implicit POSIX threads.
  45.  
  46. New feature - Cancelation of/by Win32 (non-POSIX) threads
  47. ---------------------------------------------------------
  48. Since John Bossom's original implementation, the library has allowed non-POSIX
  49. initialised threads (Win32 threads) to call pthreads-win32 routines and
  50. therefore interact with POSIX threads. This is done by creating an on-the-fly
  51. POSIX thread ID for the Win32 thread that, once created, allows fully
  52. reciprical interaction. This did not extend to thread cancelation (async or
  53. deferred). Now it does.
  54.  
  55. Any thread can be canceled by any other thread (Win32 or POSIX) if the former
  56. thread's POSIX pthread_t value is known. It's TSD destructors and POSIX
  57. cleanup handlers will be run before the thread exits with an exit code of
  58. PTHREAD_CANCELED (retrieved with GetExitCodeThread()).
  59.  
  60. This allows a Win32 thread to, for example, call POSIX CV routines in the same way
  61. that POSIX threads would/should, with pthread_cond_wait() cancelability and
  62. cleanup handlers (pthread_cond_wait() is a POSIX cancelation point).
  63.  
  64. By adding cancelation, Win32 threads should now be able to call all POSIX
  65. threads routines that make sense including semaphores, mutexes, condition
  66. variables, read/write locks, barriers, spinlocks, tsd, cleanup push/pop,
  67. cancelation, pthread_exit, scheduling, etc.
  68.  
  69. Note that these on-the-fly 'implicit' POSIX thread IDs are initialised as detached
  70. (not joinable) with deferred cancelation type. The POSIX thread ID will be created
  71. automatically by any POSIX routines that need a POSIX handle (unless the routine
  72. needs a pthread_t as a parameter of course). A Win32 thread can discover it's own
  73. POSIX thread ID by calling pthread_self(), which will create the handle if
  74. necessary and return the pthread_t value.
  75.  
  76. New tests
  77. ---------
  78. Test the above new feature.
  79.  
  80.  
  81. SNAPSHOT 2003-08-19
  82. -------------------
  83.  
  84. This snapshot fixes some accidental corruption to new test case sources.
  85. There are no changes to the library source code.
  86.  
  87.  
  88. SNAPSHOT 2003-08-15
  89. -------------------
  90.  
  91. Bug fixes
  92. ---------
  93.  
  94. * pthread.dsp now uses correct compile flags (/MD).
  95. - Viv  <vcotirlea@hotmail.com>
  96.  
  97. * pthread_win32_process_detach_np() fixed memory leak.
  98. - Steven Reddie  <Steven.Reddie@ca.com>
  99.  
  100. * pthread_mutex_destroy() fixed incorrect return code.
  101. - Nicolas Barry  <boozai@yahoo.com>
  102.  
  103. * pthread_spin_destroy() fixed memory leak.
  104. - Piet van Bruggen  <pietvb@newbridges.nl>
  105.  
  106. * Various changes to tighten arg checking, and to work with later versions of
  107. MinGW32 and MsysDTK.
  108.  
  109. * pthread_getschedparam() etc, fixed dangerous thread validity checking.
  110. - Nicolas Barry  <boozai@yahoo.com>
  111.  
  112. * POSIX thread handles are now reused and their memory is not freed on thread exit.
  113. This allows for stronger thread validity checking.
  114.  
  115. New standard routine
  116. --------------------
  117.  
  118. * pthread_kill() added to provide thread validity checking to applications.
  119. It does not accept any non zero values for the signal arg.
  120.  
  121. New test cases
  122. --------------
  123.  
  124. * New test cases to confirm validity checking, pthread_kill(), and thread reuse.
  125.  
  126.  
  127. SNAPSHOT 2003-05-10
  128. -------------------
  129.  
  130. Bug fixes
  131. ---------
  132.  
  133. * pthread_mutex_trylock() now returns correct error values.
  134. pthread_mutex_destroy() will no longer destroy a recursively locked mutex.
  135. pthread_mutex_lock() is no longer inadvertantly behaving as a cancelation point.
  136. - Thomas Pfaff  <tpfaff@gmx.net>
  137.  
  138. * pthread_mutex_timedlock() no longer occasionally sets incorrect mutex
  139. ownership, causing deadlocks in some applications.
  140. - Robert Strycek <strycek@posam.sk> and Alexander Terekhov  <TEREKHOV@de.ibm.com>
  141.  
  142.  
  143. SNAPSHOT 2002-11-04
  144. -------------------
  145.  
  146. Bug fixes
  147. ---------
  148.  
  149. * sem_getvalue() now returns the correct value under Win NT and WinCE.
  150. - Rob Fanner  <rfanner@stonethree.com>
  151.  
  152. * sem_timedwait() now uses tighter checks for unreasonable
  153. abstime values - that would result in unexpected timeout values.
  154.  
  155. * ptw32_cond_wait_cleanup() no longer mysteriously consumes
  156. CV signals but may produce more spurious wakeups. It is believed
  157. that the sem_timedwait() call is consuming a CV signal that it
  158. shouldn't.
  159. - Alexander Terekhov  <TEREKHOV@de.ibm.com>
  160.  
  161. * Fixed a memory leak in ptw32_threadDestroy() for implicit threads.
  162.  
  163. * Fixed potential for deadlock in pthread_cond_destroy().
  164. A deadlock could occur for statically declared CVs (PTHREAD_COND_INITIALIZER),
  165. when one thread is attempting to destroy the condition variable while another
  166. is attempting to dynamically initialize it.
  167. - Michael Johnson  <michaelj@maine.rr.com>
  168.  
  169.  
  170. SNAPSHOT 2002-03-02
  171. -------------------
  172.  
  173. Cleanup code default style. (IMPORTANT)
  174. ----------------------------------------------------------------------
  175. Previously, if not defined, the cleanup style was determined automatically
  176. from the compiler/language, and one of the following was defined accordingly:
  177.  
  178.         __CLEANUP_SEH   MSVC only
  179.         __CLEANUP_CXX   C++, including MSVC++, GNU G++
  180.         __CLEANUP_C             C, including GNU GCC, not MSVC
  181.  
  182. These defines determine the style of cleanup (see pthread.h) and,
  183. most importantly, the way that cancelation and thread exit (via
  184. pthread_exit) is performed (see the routine ptw32_throw() in private.c).
  185.  
  186. In short, the exceptions versions of the library throw an exception
  187. when a thread is canceled or exits (via pthread_exit()), which is
  188. caught by a handler in the thread startup routine, so that the
  189. the correct stack unwinding occurs regardless of where the thread
  190. is when it's canceled or exits via pthread_exit().
  191.  
  192. In this and future snapshots, unless the build explicitly defines (e.g.
  193. via a compiler option) __CLEANUP_SEH, __CLEANUP_CXX, or __CLEANUP_C, then
  194. the build NOW always defaults to __CLEANUP_C style cleanup. This style
  195. uses setjmp/longjmp in the cancelation and pthread_exit implementations,
  196. and therefore won't do stack unwinding even when linked to applications
  197. that have it (e.g. C++ apps). This is for consistency with most
  198. current commercial Unix POSIX threads implementations. Compaq's TRU64
  199. may be an exception (no pun intended) and possible future trend.
  200.  
  201. Although it was not clearly documented before, it is still necessary to
  202. build your application using the same __CLEANUP_* define as was
  203. used for the version of the library that you link with, so that the
  204. correct parts of pthread.h are included. That is, the possible
  205. defines require the following library versions:
  206.  
  207.         __CLEANUP_SEH   pthreadVSE.dll
  208.         __CLEANUP_CXX   pthreadVCE.dll or pthreadGCE.dll
  209.         __CLEANUP_C     pthreadVC.dll or pthreadGC.dll
  210.  
  211. E.g. regardless of whether your app is C or C++, if you link with
  212. pthreadVC.lib or libpthreadGC.a, then you must define __CLEANUP_C.
  213.  
  214.  
  215. THE POINT OF ALL THIS IS: if you have not been defining one of these
  216. explicitly, then the defaults as described at the top of this
  217. section were being used.
  218.  
  219. THIS NOW CHANGES, as has been explained above, but to try to make this
  220. clearer here's an example:
  221.  
  222. If you were building your application with MSVC++ i.e. using C++
  223. exceptions and not explicitly defining one of __CLEANUP_*, then
  224. __CLEANUP_C++ was automatically defined for you in pthread.h.
  225. You should have been linking with pthreadVCE.dll, which does
  226. stack unwinding.
  227.  
  228. If you now build your application as you had before, pthread.h will now
  229. automatically set __CLEANUP_C as the default style, and you will need to
  230. link with pthreadVC.dll. Stack unwinding will now NOT occur when a thread
  231. is canceled, or the thread calls pthread_exit().
  232.  
  233. Your application will now most likely behave differently to previous
  234. versions, and in non-obvious ways. Most likely is that locally
  235. instantiated objects may not be destroyed or cleaned up after a thread
  236. is canceled.
  237.  
  238. If you want the same behaviour as before, then you must now define
  239. __CLEANUP_C++ explicitly using a compiler option and link with
  240. pthreadVCE.dll as you did before.
  241.  
  242.  
  243. WHY ARE WE MAKING THE DEFAULT STYLE LESS EXCEPTION-FRIENDLY?
  244. Because no commercial Unix POSIX threads implementation allows you to
  245. choose to have stack unwinding. Therefore, providing it in pthread-win32
  246. as a default is dangerous. We still provide the choice but unless
  247. you consciously choose to do otherwise, your pthreads applications will
  248. now run or crash in similar ways irrespective of the threads platform
  249. you use. Or at least this is the hope.
  250.  
  251.  
  252. WHY NOT REMOVE THE EXCEPTIONS VERSIONS OF THE LIBRARY ALTOGETHER?
  253. There are a few reasons:
  254. - because there are well respected POSIX threads people who believe
  255.   that POSIX threads implementations should be exceptions aware and
  256.   do the expected thing in that context. (There are equally respected
  257.   people who believe it should not be easily accessible, if it's there
  258.   at all, for unconditional conformity to other implementations.)
  259. - because pthreads-win32 is one of the few implementations that has
  260.   the choice, perhaps the only freely available one, and so offers
  261.   a laboratory to people who may want to explore the effects;
  262. - although the code will always be around somewhere for anyone who
  263.   wants it, once it's removed from the current version it will not be
  264.   nearly as visible to people who may have a use for it.
  265.  
  266.  
  267. Source module splitting
  268. -----------------------
  269. In order to enable smaller image sizes to be generated
  270. for applications that link statically with the library,
  271. most routines have been separated out into individual
  272. source code files.
  273.  
  274. This is being done in such a way as to be backward compatible.
  275. The old source files are reused to congregate the individual
  276. routine files into larger translation units (via a bunch of
  277. # includes) so that the compiler can still optimise wherever
  278. possible, e.g. through inlining, which can only be done
  279. within the same translation unit.
  280.  
  281. It is also possible to build the entire library by compiling
  282. the single file named "pthread.c", which just #includes all
  283. the secondary congregation source files. The compiler
  284. may be able to use this to do more inlining of routines.
  285.  
  286. Although the GNU compiler is able to produce libraries with
  287. the necessary separation (the -ffunction-segments switch),
  288. AFAIK, the MSVC and other compilers don't have this feature.
  289.  
  290. Finally, since I use makefiles and command-line compilation,
  291. I don't know what havoc this reorganisation may wreak amongst
  292. IDE project file users. You should be able to continue
  293. using your existing project files without modification.
  294.  
  295.  
  296. New non-portable functions
  297. --------------------------
  298. pthread_num_processors_np():
  299.   Returns the number of processors in the system that are
  300.   available to the process, as determined from the processor
  301.   affinity mask.
  302.  
  303. pthread_timechange_handler_np():
  304.   To improve tolerance against operator or time service initiated
  305.   system clock changes.
  306.  
  307.   This routine can be called by an application when it
  308.   receives a WM_TIMECHANGE message from the system. At present
  309.   it broadcasts all condition variables so that waiting threads
  310.   can wake up and re-evaluate their conditions and restart
  311.   their timed waits if required.
  312.   - Suggested by Alexander Terekhov
  313.  
  314.  
  315. Platform dependence
  316. -------------------
  317. As Win95 doesn't provide one, the library now contains
  318. it's own InterlockedCompareExchange() routine, which is used
  319. whenever Windows doesn't provide it. InterlockedCompareExchange()
  320. is used to implement spinlocks and barriers, and also in mutexes.
  321. This routine relies on the CMPXCHG machine instruction which
  322. is not available on i386 CPUs. This library (from snapshot
  323. 20010712 onwards) is therefore no longer supported on i386
  324. processor platforms.
  325.  
  326.  
  327. New standard routines
  328. ---------------------
  329. For source code portability only - rwlocks cannot be process shared yet.
  330.  
  331.         pthread_rwlockattr_init()
  332.         pthread_rwlockattr_destroy()
  333.         pthread_rwlockattr_setpshared()
  334.         pthread_rwlockattr_getpshared()
  335.  
  336. As defined in the new POSIX standard, and the Single Unix Spec version 3:
  337.  
  338.         sem_timedwait()
  339.         pthread_mutex_timedlock()    - Alexander Terekhov and Thomas Pfaff
  340.         pthread_rwlock_timedrdlock() - adapted from pthread_rwlock_rdlock()
  341.         pthread_rwlock_timedwrlock() - adapted from pthread_rwlock_wrlock()
  342.  
  343.  
  344. pthread.h no longer includes windows.h
  345. --------------------------------------
  346. [Not yet for G++]
  347.  
  348. This was done to prevent conflicts.
  349.  
  350. HANDLE, DWORD, and NULL are temporarily defined within pthread.h if
  351. they are not already.
  352.  
  353.  
  354. pthread.h, sched.h and semaphore.h now use dllexport/dllimport
  355. --------------------------------------------------------------
  356. Not only to avoid the need for the pthread.def file, but to
  357. improve performance. Apparently, declaring functions with dllimport
  358. generates a direct call to the function and avoids the overhead
  359. of a stub function call.
  360.  
  361. Bug fixes
  362. ---------
  363. * Fixed potential NULL pointer dereferences in pthread_mutexattr_init,
  364. pthread_mutexattr_getpshared, pthread_barrierattr_init,
  365. pthread_barrierattr_getpshared, and pthread_condattr_getpshared.
  366. - Scott McCaskill <scott@magruder.org>
  367.  
  368. * Removed potential race condition in pthread_mutex_trylock and
  369. pthread_mutex_lock;
  370. - Alexander Terekhov <TEREKHOV@de.ibm.com>
  371.  
  372. * The behaviour of pthread_mutex_trylock in relation to
  373. recursive mutexes was inconsistent with commercial implementations.
  374. Trylock would return EBUSY if the lock was owned already by the
  375. calling thread regardless of mutex type. Trylock now increments the
  376. recursion count and returns 0 for RECURSIVE mutexes, and will
  377. return EDEADLK rather than EBUSY for ERRORCHECK mutexes. This is
  378. consistent with Solaris.
  379. - Thomas Pfaff <tpfaff@gmx.net>
  380.  
  381. * Found a fix for the library and workaround for applications for
  382. the known bug #2, i.e. where __CLEANUP_CXX or __CLEANUP_SEH is defined.
  383. See the "Known Bugs in this snapshot" section below.
  384.  
  385. This could be made transparent to applications by replacing the macros that
  386. define the current C++ and SEH versions of pthread_cleanup_push/pop
  387. with the C version, but AFAIK cleanup handlers would not then run in the
  388. correct sequence with destructors and exception cleanup handlers when
  389. an exception occurs.
  390.  
  391. * Cancelation once started in a thread cannot now be inadvertantly
  392. double canceled. That is, once a thread begins it's cancelation run,
  393. cancelation is disabled and a subsequent cancel request will
  394. return an error (ESRCH).
  395.  
  396. * errno: An incorrect compiler directive caused a local version
  397. of errno to be used instead of the Win32 errno. Both instances are
  398. thread-safe but applications checking errno after a pthreads-win32
  399. call would be wrong. Fixing this also fixed a bad compiler
  400. option in the testsuite (/MT should have been /MD) which is
  401. needed to link with the correct library MSVCRT.LIB.
  402.  
  403.  
  404. SNAPSHOT 2001-07-12
  405. -------------------
  406.  
  407. To be added
  408.  
  409.  
  410. SNAPSHOT 2001-07-03
  411. -------------------
  412.  
  413. To be added
  414.  
  415.  
  416. SNAPSHOT 2000-08-13
  417. -------------------
  418.  
  419. New:
  420. -       Renamed DLL and LIB files:
  421.                 pthreadVSE.dll  (MS VC++/Structured EH)
  422.                 pthreadVSE.lib
  423.                 pthreadVCE.dll  (MS VC++/C++ EH)
  424.                 pthreadVCE.lib
  425.                 pthreadGCE.dll  (GNU G++/C++ EH)
  426.                 libpthreadw32.a
  427.  
  428.         Both your application and the pthread dll should use the
  429.         same exception handling scheme.
  430.  
  431. Bugs fixed:
  432. -       MSVC++ C++ exception handling.
  433.  
  434. Some new tests have been added.
  435.  
  436.  
  437. SNAPSHOT 2000-08-10
  438. -------------------
  439.  
  440. New:
  441. -       asynchronous cancelation on X86 (Jason Nye)
  442. -       Makefile compatible with MS nmake to replace
  443.         buildlib.bat
  444. -       GNUmakefile for Mingw32
  445. -       tests/Makefile for MS nmake replaces runall.bat
  446. -       tests/GNUmakefile for Mingw32
  447.  
  448. Bugs fixed:
  449. -       kernel32 load/free problem
  450. -       attempt to hide internel exceptions from application
  451.         exception handlers (__try/__except and try/catch blocks)
  452. -       Win32 thread handle leakage bug
  453.         (David Baggett/Paul Redondo/Eyal Lebedinsky)
  454.  
  455. Some new tests have been added.
  456.  
  457.  
  458. SNAPSHOT 1999-11-02
  459. -------------------
  460.  
  461. Bugs fixed:
  462. -       ctime_r macro had an incorrect argument (Erik Hensema),
  463. -       threads were not being created 
  464.         PTHREAD_CANCEL_DEFERRED. This should have
  465.         had little effect as deferred is the only
  466.         supported type. (Ross Johnson).
  467.  
  468. Some compatibility improvements added, eg.
  469. -       pthread_setcancelstate accepts NULL pointer
  470.         for the previous value argument. Ditto for
  471.         pthread_setcanceltype. This is compatible
  472.         with Solaris but should not affect
  473.         standard applications (Erik Hensema)
  474.  
  475. Some new tests have been added.
  476.  
  477.  
  478. SNAPSHOT 1999-10-17
  479. -------------------
  480.  
  481. Bug fix - Cancelation of threads waiting on condition variables
  482. now works properly (Lorin Hochstein and Peter Slacik)
  483.  
  484.  
  485. SNAPSHOT 1999-08-12
  486. -------------------
  487.  
  488. Fixed exception stack cleanup if calling pthread_exit()
  489. - (Lorin Hochstein and John Bossom).
  490.  
  491. Fixed bugs in condition variables - (Peter Slacik):
  492.         - additional contention checks
  493.         - properly adjust number of waiting threads after timed
  494.           condvar timeout.
  495.  
  496.  
  497. SNAPSHOT 1999-05-30
  498. -------------------
  499.  
  500. Some minor bugs have been fixed. See the ChangeLog file for details.
  501.  
  502. Some more POSIX 1b functions are now included but ony return an
  503. error (ENOSYS) if called. They are:
  504.  
  505.         sem_open
  506.         sem_close
  507.         sem_unlink
  508.         sem_getvalue
  509.  
  510.  
  511. SNAPSHOT 1999-04-07
  512. -------------------
  513.  
  514. Some POSIX 1b functions which were internally supported are now
  515. available as exported functions:
  516.  
  517.         sem_init
  518.         sem_destroy
  519.         sem_wait
  520.         sem_trywait
  521.         sem_post
  522.         sched_yield
  523.         sched_get_priority_min
  524.         sched_get_priority_max
  525.  
  526. Some minor bugs have been fixed. See the ChangeLog file for details.
  527.  
  528.  
  529. SNAPSHOT 1999-03-16
  530. -------------------
  531.  
  532. Initial release.
  533.  
  534.