noderb 0.0.4 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (361) hide show
  1. data/ext/noderb_extension/libuv/AUTHORS +11 -1
  2. data/ext/noderb_extension/libuv/LICENSE +0 -8
  3. data/ext/noderb_extension/libuv/Makefile +5 -5
  4. data/ext/noderb_extension/libuv/README +11 -6
  5. data/ext/noderb_extension/libuv/common.gypi +158 -7
  6. data/ext/noderb_extension/libuv/config-unix.mk +34 -26
  7. data/ext/noderb_extension/libuv/gyp_uv +22 -4
  8. data/ext/noderb_extension/libuv/include/{eio.h → uv-private/eio.h} +2 -2
  9. data/ext/noderb_extension/libuv/include/{uv-unix.h → uv-private/uv-unix.h} +40 -0
  10. data/ext/noderb_extension/libuv/include/{uv-win.h → uv-private/uv-win.h} +96 -14
  11. data/ext/noderb_extension/libuv/include/uv.h +508 -83
  12. data/ext/noderb_extension/libuv/src/unix/cares.c +185 -0
  13. data/ext/noderb_extension/libuv/src/unix/core.c +828 -0
  14. data/ext/noderb_extension/libuv/src/{eio → unix/eio}/config_darwin.h +4 -0
  15. data/ext/noderb_extension/libuv/src/{eio → unix/eio}/config_linux.h +5 -15
  16. data/ext/noderb_extension/libuv/src/{eio → unix/eio}/eio.c +23 -2
  17. data/ext/noderb_extension/libuv/src/unix/error.c +102 -0
  18. data/ext/noderb_extension/libuv/src/{ev → unix/ev}/config_linux.h +26 -15
  19. data/ext/noderb_extension/libuv/src/unix/fs.c +562 -0
  20. data/ext/noderb_extension/libuv/src/unix/internal.h +75 -0
  21. data/ext/noderb_extension/libuv/src/unix/pipe.c +282 -0
  22. data/ext/noderb_extension/libuv/src/unix/process.c +287 -0
  23. data/ext/noderb_extension/libuv/src/unix/stream.c +727 -0
  24. data/ext/noderb_extension/libuv/src/unix/tcp.c +226 -0
  25. data/ext/noderb_extension/libuv/src/unix/udp.c +524 -0
  26. data/ext/noderb_extension/libuv/src/{uv-eio.c → unix/uv-eio.c} +48 -27
  27. data/ext/noderb_extension/libuv/src/{uv-eio.h → unix/uv-eio.h} +1 -1
  28. data/ext/noderb_extension/libuv/src/uv-common.c +24 -14
  29. data/ext/noderb_extension/libuv/src/uv-common.h +12 -7
  30. data/ext/noderb_extension/libuv/src/win/async.c +14 -16
  31. data/ext/noderb_extension/libuv/src/win/cares.c +64 -79
  32. data/ext/noderb_extension/libuv/src/win/core.c +105 -53
  33. data/ext/noderb_extension/libuv/src/win/error.c +23 -13
  34. data/ext/noderb_extension/libuv/src/win/fs.c +807 -0
  35. data/ext/noderb_extension/libuv/src/win/getaddrinfo.c +61 -41
  36. data/ext/noderb_extension/libuv/src/win/handle.c +56 -30
  37. data/ext/noderb_extension/libuv/src/win/internal.h +134 -95
  38. data/ext/noderb_extension/libuv/src/win/loop-watcher.c +21 -18
  39. data/ext/noderb_extension/libuv/src/win/pipe.c +313 -158
  40. data/ext/noderb_extension/libuv/src/win/process.c +117 -131
  41. data/ext/noderb_extension/libuv/src/win/req.c +55 -31
  42. data/ext/noderb_extension/libuv/src/win/stdio.c +5 -5
  43. data/ext/noderb_extension/libuv/src/win/stream.c +19 -14
  44. data/ext/noderb_extension/libuv/src/win/tcp.c +278 -336
  45. data/ext/noderb_extension/libuv/src/win/threadpool.c +73 -0
  46. data/ext/noderb_extension/libuv/src/win/timer.c +44 -37
  47. data/ext/noderb_extension/libuv/src/win/udp.c +592 -0
  48. data/ext/noderb_extension/libuv/src/win/util.c +20 -6
  49. data/ext/noderb_extension/libuv/src/win/winapi.c +23 -6
  50. data/ext/noderb_extension/libuv/src/win/winapi.h +4206 -0
  51. data/ext/noderb_extension/libuv/src/win/winsock.c +270 -0
  52. data/ext/noderb_extension/libuv/src/win/winsock.h +134 -0
  53. data/ext/noderb_extension/libuv/test/benchmark-ares.c +10 -6
  54. data/ext/noderb_extension/libuv/test/benchmark-getaddrinfo.c +10 -7
  55. data/ext/noderb_extension/libuv/test/benchmark-list.h +21 -0
  56. data/ext/noderb_extension/libuv/test/benchmark-ping-pongs.c +11 -7
  57. data/ext/noderb_extension/libuv/test/benchmark-pound.c +147 -58
  58. data/ext/noderb_extension/libuv/test/benchmark-pump.c +29 -23
  59. data/ext/noderb_extension/libuv/test/benchmark-spawn.c +13 -10
  60. data/ext/noderb_extension/libuv/test/benchmark-udp-packet-storm.c +250 -0
  61. data/ext/noderb_extension/libuv/test/dns-server.c +11 -6
  62. data/ext/noderb_extension/libuv/test/echo-server.c +30 -22
  63. data/ext/noderb_extension/libuv/test/test-async.c +3 -3
  64. data/ext/noderb_extension/libuv/test/test-callback-stack.c +6 -6
  65. data/ext/noderb_extension/libuv/test/test-connection-fail.c +6 -5
  66. data/ext/noderb_extension/libuv/test/test-delayed-accept.c +13 -13
  67. data/ext/noderb_extension/libuv/test/test-fs.c +715 -0
  68. data/ext/noderb_extension/libuv/test/test-getaddrinfo.c +11 -8
  69. data/ext/noderb_extension/libuv/test/test-gethostbyname.c +8 -9
  70. data/ext/noderb_extension/libuv/test/test-getsockname.c +142 -16
  71. data/ext/noderb_extension/libuv/test/test-idle.c +4 -3
  72. data/ext/noderb_extension/libuv/test/test-list.h +29 -2
  73. data/ext/noderb_extension/libuv/test/test-loop-handles.c +9 -8
  74. data/ext/noderb_extension/libuv/test/test-ping-pong.c +9 -9
  75. data/ext/noderb_extension/libuv/test/test-pipe-bind-error.c +18 -14
  76. data/ext/noderb_extension/libuv/test/test-ref.c +17 -16
  77. data/ext/noderb_extension/libuv/test/test-shutdown-eof.c +5 -5
  78. data/ext/noderb_extension/libuv/test/test-spawn.c +17 -17
  79. data/ext/noderb_extension/libuv/test/test-tcp-bind-error.c +24 -18
  80. data/ext/noderb_extension/libuv/test/test-tcp-bind6-error.c +19 -14
  81. data/ext/noderb_extension/libuv/test/test-tcp-writealot.c +6 -5
  82. data/ext/noderb_extension/libuv/test/test-threadpool.c +59 -0
  83. data/ext/noderb_extension/libuv/test/test-timer-again.c +15 -12
  84. data/ext/noderb_extension/libuv/test/test-timer.c +8 -8
  85. data/ext/noderb_extension/libuv/test/test-udp-dgram-too-big.c +88 -0
  86. data/ext/noderb_extension/libuv/test/test-udp-ipv6.c +158 -0
  87. data/ext/noderb_extension/libuv/test/test-udp-send-and-recv.c +210 -0
  88. data/ext/noderb_extension/libuv/{all.gyp → uv.gyp} +75 -77
  89. data/ext/noderb_extension/libuv/vcbuild.bat +93 -0
  90. data/ext/noderb_extension/noderb.c +13 -0
  91. data/ext/noderb_extension/noderb_common.h +2 -1
  92. data/ext/noderb_extension/noderb_defer.c +54 -0
  93. data/ext/noderb_extension/noderb_defer.h +15 -0
  94. data/ext/noderb_extension/noderb_dns.c +1 -1
  95. data/ext/noderb_extension/noderb_fs.c +277 -0
  96. data/ext/noderb_extension/noderb_fs.h +27 -0
  97. data/ext/noderb_extension/noderb_process.c +5 -5
  98. data/ext/noderb_extension/noderb_tcp.c +10 -6
  99. data/ext/noderb_extension/noderb_timers.c +1 -1
  100. data/ext/noderb_extension/noderb_tools.c +42 -8
  101. data/ext/noderb_extension/noderb_tools.h +3 -1
  102. data/lib/noderb/defer.rb +25 -0
  103. data/lib/noderb/file.rb +119 -0
  104. data/lib/noderb/fs.rb +72 -0
  105. data/lib/noderb/version.rb +1 -1
  106. data/lib/noderb.rb +8 -0
  107. metadata +102 -266
  108. data/ext/noderb_extension/libuv/BSDmakefile +0 -2
  109. data/ext/noderb_extension/libuv/create-msvs-files.bat +0 -21
  110. data/ext/noderb_extension/libuv/deps/pthread-win32/ANNOUNCE +0 -482
  111. data/ext/noderb_extension/libuv/deps/pthread-win32/BUGS +0 -141
  112. data/ext/noderb_extension/libuv/deps/pthread-win32/Bmakefile +0 -268
  113. data/ext/noderb_extension/libuv/deps/pthread-win32/CONTRIBUTORS +0 -140
  114. data/ext/noderb_extension/libuv/deps/pthread-win32/COPYING +0 -150
  115. data/ext/noderb_extension/libuv/deps/pthread-win32/COPYING.LIB +0 -504
  116. data/ext/noderb_extension/libuv/deps/pthread-win32/ChangeLog +0 -5194
  117. data/ext/noderb_extension/libuv/deps/pthread-win32/FAQ +0 -451
  118. data/ext/noderb_extension/libuv/deps/pthread-win32/GNUmakefile +0 -593
  119. data/ext/noderb_extension/libuv/deps/pthread-win32/MAINTAINERS +0 -4
  120. data/ext/noderb_extension/libuv/deps/pthread-win32/Makefile +0 -516
  121. data/ext/noderb_extension/libuv/deps/pthread-win32/NEWS +0 -1245
  122. data/ext/noderb_extension/libuv/deps/pthread-win32/Nmakefile +0 -24
  123. data/ext/noderb_extension/libuv/deps/pthread-win32/Nmakefile.tests +0 -260
  124. data/ext/noderb_extension/libuv/deps/pthread-win32/PROGRESS +0 -4
  125. data/ext/noderb_extension/libuv/deps/pthread-win32/README +0 -601
  126. data/ext/noderb_extension/libuv/deps/pthread-win32/README.Borland +0 -57
  127. data/ext/noderb_extension/libuv/deps/pthread-win32/README.CV +0 -3036
  128. data/ext/noderb_extension/libuv/deps/pthread-win32/README.NONPORTABLE +0 -783
  129. data/ext/noderb_extension/libuv/deps/pthread-win32/README.Watcom +0 -62
  130. data/ext/noderb_extension/libuv/deps/pthread-win32/README.WinCE +0 -6
  131. data/ext/noderb_extension/libuv/deps/pthread-win32/TODO +0 -7
  132. data/ext/noderb_extension/libuv/deps/pthread-win32/WinCE-PORT +0 -222
  133. data/ext/noderb_extension/libuv/deps/pthread-win32/attr.c +0 -53
  134. data/ext/noderb_extension/libuv/deps/pthread-win32/autostatic.c +0 -69
  135. data/ext/noderb_extension/libuv/deps/pthread-win32/barrier.c +0 -47
  136. data/ext/noderb_extension/libuv/deps/pthread-win32/build/all.gyp +0 -207
  137. data/ext/noderb_extension/libuv/deps/pthread-win32/builddmc.bat +0 -9
  138. data/ext/noderb_extension/libuv/deps/pthread-win32/cancel.c +0 -44
  139. data/ext/noderb_extension/libuv/deps/pthread-win32/cleanup.c +0 -148
  140. data/ext/noderb_extension/libuv/deps/pthread-win32/condvar.c +0 -50
  141. data/ext/noderb_extension/libuv/deps/pthread-win32/config.h +0 -153
  142. data/ext/noderb_extension/libuv/deps/pthread-win32/context.h +0 -74
  143. data/ext/noderb_extension/libuv/deps/pthread-win32/create.c +0 -308
  144. data/ext/noderb_extension/libuv/deps/pthread-win32/dll.c +0 -92
  145. data/ext/noderb_extension/libuv/deps/pthread-win32/errno.c +0 -94
  146. data/ext/noderb_extension/libuv/deps/pthread-win32/exit.c +0 -44
  147. data/ext/noderb_extension/libuv/deps/pthread-win32/fork.c +0 -39
  148. data/ext/noderb_extension/libuv/deps/pthread-win32/global.c +0 -107
  149. data/ext/noderb_extension/libuv/deps/pthread-win32/implement.h +0 -944
  150. data/ext/noderb_extension/libuv/deps/pthread-win32/misc.c +0 -50
  151. data/ext/noderb_extension/libuv/deps/pthread-win32/mutex.c +0 -62
  152. data/ext/noderb_extension/libuv/deps/pthread-win32/need_errno.h +0 -145
  153. data/ext/noderb_extension/libuv/deps/pthread-win32/nonportable.c +0 -47
  154. data/ext/noderb_extension/libuv/deps/pthread-win32/private.c +0 -54
  155. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread.c +0 -66
  156. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread.dsp +0 -142
  157. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread.dsw +0 -29
  158. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread.h +0 -1368
  159. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_destroy.c +0 -79
  160. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_getdetachstate.c +0 -86
  161. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_getinheritsched.c +0 -51
  162. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_getschedparam.c +0 -52
  163. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_getschedpolicy.c +0 -61
  164. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_getscope.c +0 -54
  165. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_getstackaddr.c +0 -97
  166. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_getstacksize.c +0 -100
  167. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_init.c +0 -117
  168. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_setdetachstate.c +0 -91
  169. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_setinheritsched.c +0 -57
  170. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_setschedparam.c +0 -63
  171. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_setschedpolicy.c +0 -55
  172. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_setscope.c +0 -62
  173. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_setstackaddr.c +0 -97
  174. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_attr_setstacksize.c +0 -110
  175. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_barrier_destroy.c +0 -103
  176. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_barrier_init.c +0 -69
  177. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_barrier_wait.c +0 -104
  178. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_barrierattr_destroy.c +0 -83
  179. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_barrierattr_getpshared.c +0 -95
  180. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_barrierattr_init.c +0 -85
  181. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_barrierattr_setpshared.c +0 -119
  182. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_cancel.c +0 -189
  183. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_cond_destroy.c +0 -253
  184. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_cond_init.c +0 -167
  185. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_cond_signal.c +0 -231
  186. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_cond_wait.c +0 -567
  187. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_condattr_destroy.c +0 -86
  188. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_condattr_getpshared.c +0 -97
  189. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_condattr_init.c +0 -87
  190. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_condattr_setpshared.c +0 -117
  191. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_delay_np.c +0 -172
  192. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_detach.c +0 -136
  193. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_equal.c +0 -76
  194. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_exit.c +0 -106
  195. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_getconcurrency.c +0 -45
  196. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_getschedparam.c +0 -75
  197. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_getspecific.c +0 -87
  198. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_getunique_np.c +0 -47
  199. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_getw32threadhandle_np.c +0 -65
  200. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_join.c +0 -157
  201. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_key_create.c +0 -108
  202. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_key_delete.c +0 -125
  203. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_kill.c +0 -105
  204. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutex_consistent.c +0 -187
  205. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutex_destroy.c +0 -148
  206. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutex_init.c +0 -130
  207. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutex_lock.c +0 -269
  208. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutex_timedlock.c +0 -324
  209. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutex_trylock.c +0 -154
  210. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutex_unlock.c +0 -175
  211. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutexattr_destroy.c +0 -83
  212. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutexattr_getkind_np.c +0 -44
  213. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutexattr_getpshared.c +0 -95
  214. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutexattr_getrobust.c +0 -113
  215. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutexattr_gettype.c +0 -56
  216. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutexattr_init.c +0 -86
  217. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutexattr_setkind_np.c +0 -44
  218. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutexattr_setpshared.c +0 -119
  219. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutexattr_setrobust.c +0 -119
  220. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_mutexattr_settype.c +0 -143
  221. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_num_processors_np.c +0 -56
  222. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_once.c +0 -79
  223. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlock_destroy.c +0 -143
  224. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlock_init.c +0 -109
  225. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlock_rdlock.c +0 -102
  226. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlock_timedrdlock.c +0 -109
  227. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlock_timedwrlock.c +0 -139
  228. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlock_tryrdlock.c +0 -102
  229. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlock_trywrlock.c +0 -122
  230. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlock_unlock.c +0 -93
  231. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlock_wrlock.c +0 -133
  232. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlockattr_destroy.c +0 -84
  233. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlockattr_getpshared.c +0 -97
  234. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlockattr_init.c +0 -83
  235. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_rwlockattr_setpshared.c +0 -120
  236. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_self.c +0 -141
  237. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_setcancelstate.c +0 -125
  238. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_setcanceltype.c +0 -126
  239. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_setconcurrency.c +0 -53
  240. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_setschedparam.c +0 -123
  241. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_setspecific.c +0 -167
  242. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_spin_destroy.c +0 -111
  243. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_spin_init.c +0 -123
  244. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_spin_lock.c +0 -80
  245. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_spin_trylock.c +0 -77
  246. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_spin_unlock.c +0 -71
  247. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_testcancel.c +0 -103
  248. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_timechange_handler_np.c +0 -108
  249. data/ext/noderb_extension/libuv/deps/pthread-win32/pthread_win32_attach_detach_np.c +0 -258
  250. data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_MCS_lock.c +0 -278
  251. data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_callUserDestroyRoutines.c +0 -232
  252. data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_calloc.c +0 -56
  253. data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_cond_check_need_init.c +0 -78
  254. data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_getprocessors.c +0 -91
  255. data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_is_attr.c +0 -47
  256. data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_mutex_check_need_init.c +0 -92
  257. data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_new.c +0 -94
  258. data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_processInitialize.c +0 -92
  259. data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_processTerminate.c +0 -105
  260. data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_relmillisecs.c +0 -132
  261. data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_reuse.c +0 -151
  262. data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_rwlock_cancelwrwait.c +0 -50
  263. data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_rwlock_check_need_init.c +0 -77
  264. data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_semwait.c +0 -135
  265. data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_spinlock_check_need_init.c +0 -78
  266. data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_threadDestroy.c +0 -79
  267. data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_threadStart.c +0 -357
  268. data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_throw.c +0 -189
  269. data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_timespec.c +0 -83
  270. data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_tkAssocCreate.c +0 -118
  271. data/ext/noderb_extension/libuv/deps/pthread-win32/ptw32_tkAssocDestroy.c +0 -114
  272. data/ext/noderb_extension/libuv/deps/pthread-win32/rwlock.c +0 -51
  273. data/ext/noderb_extension/libuv/deps/pthread-win32/sched.c +0 -53
  274. data/ext/noderb_extension/libuv/deps/pthread-win32/sched.h +0 -183
  275. data/ext/noderb_extension/libuv/deps/pthread-win32/sched_get_priority_max.c +0 -134
  276. data/ext/noderb_extension/libuv/deps/pthread-win32/sched_get_priority_min.c +0 -135
  277. data/ext/noderb_extension/libuv/deps/pthread-win32/sched_getscheduler.c +0 -71
  278. data/ext/noderb_extension/libuv/deps/pthread-win32/sched_setscheduler.c +0 -83
  279. data/ext/noderb_extension/libuv/deps/pthread-win32/sched_yield.c +0 -71
  280. data/ext/noderb_extension/libuv/deps/pthread-win32/sem_close.c +0 -58
  281. data/ext/noderb_extension/libuv/deps/pthread-win32/sem_destroy.c +0 -144
  282. data/ext/noderb_extension/libuv/deps/pthread-win32/sem_getvalue.c +0 -110
  283. data/ext/noderb_extension/libuv/deps/pthread-win32/sem_init.c +0 -169
  284. data/ext/noderb_extension/libuv/deps/pthread-win32/sem_open.c +0 -58
  285. data/ext/noderb_extension/libuv/deps/pthread-win32/sem_post.c +0 -128
  286. data/ext/noderb_extension/libuv/deps/pthread-win32/sem_post_multiple.c +0 -142
  287. data/ext/noderb_extension/libuv/deps/pthread-win32/sem_timedwait.c +0 -238
  288. data/ext/noderb_extension/libuv/deps/pthread-win32/sem_trywait.c +0 -117
  289. data/ext/noderb_extension/libuv/deps/pthread-win32/sem_unlink.c +0 -58
  290. data/ext/noderb_extension/libuv/deps/pthread-win32/sem_wait.c +0 -187
  291. data/ext/noderb_extension/libuv/deps/pthread-win32/semaphore.c +0 -69
  292. data/ext/noderb_extension/libuv/deps/pthread-win32/semaphore.h +0 -169
  293. data/ext/noderb_extension/libuv/deps/pthread-win32/signal.c +0 -179
  294. data/ext/noderb_extension/libuv/deps/pthread-win32/spin.c +0 -46
  295. data/ext/noderb_extension/libuv/deps/pthread-win32/sync.c +0 -43
  296. data/ext/noderb_extension/libuv/deps/pthread-win32/tsd.c +0 -44
  297. data/ext/noderb_extension/libuv/deps/pthread-win32/version.rc +0 -388
  298. data/ext/noderb_extension/libuv/deps/pthread-win32/w32_CancelableWait.c +0 -161
  299. data/ext/noderb_extension/libuv/doc/iocp-links.html +0 -574
  300. data/ext/noderb_extension/libuv/src/uv-unix.c +0 -2421
  301. data/ext/noderb_extension/libuv/src/win/ntdll.h +0 -130
  302. /data/ext/noderb_extension/libuv/include/{ev.h → uv-private/ev.h} +0 -0
  303. /data/ext/noderb_extension/libuv/include/{ngx-queue.h → uv-private/ngx-queue.h} +0 -0
  304. /data/ext/noderb_extension/libuv/include/{tree.h → uv-private/tree.h} +0 -0
  305. /data/ext/noderb_extension/libuv/src/{uv-cygwin.c → unix/cygwin.c} +0 -0
  306. /data/ext/noderb_extension/libuv/src/{uv-darwin.c → unix/darwin.c} +0 -0
  307. /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/Changes +0 -0
  308. /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/LICENSE +0 -0
  309. /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/Makefile.am +0 -0
  310. /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/aclocal.m4 +0 -0
  311. /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/autogen.sh +0 -0
  312. /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/config.h.in +0 -0
  313. /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/config_cygwin.h +0 -0
  314. /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/config_freebsd.h +0 -0
  315. /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/config_sunos.h +0 -0
  316. /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/configure.ac +0 -0
  317. /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/demo.c +0 -0
  318. /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/ecb.h +0 -0
  319. /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/eio.3 +0 -0
  320. /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/eio.pod +0 -0
  321. /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/libeio.m4 +0 -0
  322. /data/ext/noderb_extension/libuv/src/{eio → unix/eio}/xthread.h +0 -0
  323. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/Changes +0 -0
  324. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/LICENSE +0 -0
  325. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/Makefile.am +0 -0
  326. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/Makefile.in +0 -0
  327. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/README +0 -0
  328. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/aclocal.m4 +0 -0
  329. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/autogen.sh +0 -0
  330. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/config.guess +0 -0
  331. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/config.h.in +0 -0
  332. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/config.sub +0 -0
  333. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/config_cygwin.h +0 -0
  334. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/config_darwin.h +0 -0
  335. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/config_freebsd.h +0 -0
  336. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/config_sunos.h +0 -0
  337. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/configure +0 -0
  338. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/configure.ac +0 -0
  339. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/depcomp +0 -0
  340. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ev++.h +0 -0
  341. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ev.3 +0 -0
  342. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ev.c +0 -0
  343. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ev.pod +0 -0
  344. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ev_epoll.c +0 -0
  345. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ev_kqueue.c +0 -0
  346. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ev_poll.c +0 -0
  347. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ev_port.c +0 -0
  348. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ev_select.c +0 -0
  349. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ev_vars.h +0 -0
  350. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ev_win32.c +0 -0
  351. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ev_wrap.h +0 -0
  352. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/event.c +0 -0
  353. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/event.h +0 -0
  354. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/install-sh +0 -0
  355. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/libev.m4 +0 -0
  356. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/ltmain.sh +0 -0
  357. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/missing +0 -0
  358. /data/ext/noderb_extension/libuv/src/{ev → unix/ev}/mkinstalldirs +0 -0
  359. /data/ext/noderb_extension/libuv/src/{uv-freebsd.c → unix/freebsd.c} +0 -0
  360. /data/ext/noderb_extension/libuv/src/{uv-linux.c → unix/linux.c} +0 -0
  361. /data/ext/noderb_extension/libuv/src/{uv-sunos.c → unix/sunos.c} +0 -0
@@ -1,451 +0,0 @@
1
- =========================================
2
- PTHREADS-WIN32 Frequently Asked Questions
3
- =========================================
4
-
5
- INDEX
6
- -----
7
-
8
- Q 1 What is it?
9
-
10
- Q 2 Which of the several dll versions do I use?
11
- or,
12
- What are all these pthread*.dll and pthread*.lib files?
13
-
14
- Q 3 What is the library naming convention?
15
-
16
- Q 4 Cleanup code default style or: it used to work when I built
17
- the library myself, but now it doesn't - why?
18
-
19
- Q 5 Why is the default library version now less exception-friendly?
20
-
21
- Q 6 Should I use Cygwin or Mingw32 as a development environment?
22
-
23
- Q 7 Now that pthreads-win32 builds under Mingw32, why do I get
24
- memory access violations (segfaults)?
25
-
26
- Q 8 How do I use pthread.dll for Win32 (Visual C++ 5.0)
27
-
28
- Q 9 Cancelation doesn't work for me, why?
29
-
30
- Q 10 How do I generate pthreadGCE.dll and libpthreadw32.a for use
31
- with Mingw32?
32
-
33
- Q 11 Why isn't pthread_t defined as a scalar (e.g. pointer or int)
34
- like it is for other POSIX threads implementations?
35
-
36
- =============================================================================
37
-
38
- Q 1 What is it?
39
- ---
40
-
41
- Pthreads-win32 is an Open Source Software implementation of the
42
- Threads component of the POSIX 1003.1c 1995 Standard for Microsoft's
43
- Win32 environment. Some functions from POSIX 1003.1b are also
44
- supported including semaphores. Other related functions include
45
- the set of read-write lock functions. The library also supports
46
- some of the functionality of the Open Group's Single Unix
47
- specification, version 2, namely mutex types.
48
-
49
- See the file "ANNOUNCE" for more information including standards
50
- conformance details and list of supported routines.
51
-
52
-
53
- ------------------------------------------------------------------------------
54
-
55
- Q 2 Which of the several dll versions do I use?
56
- --- or,
57
- What are all these pthread*.dll and pthread*.lib files?
58
-
59
- Simply, you only use one of them, but you need to choose carefully.
60
-
61
- The most important choice you need to make is whether to use a
62
- version that uses exceptions internally, or not (there are versions
63
- of the library that use exceptions as part of the thread
64
- cancelation and cleanup implementation, and one that uses
65
- setjmp/longjmp instead).
66
-
67
- There is some contension amongst POSIX threads experts as
68
- to how POSIX threads cancelation and exit should work
69
- with languages that include exceptions and handlers, e.g.
70
- C++ and even C (Microsoft's Structured Exceptions).
71
-
72
- The issue is: should cancelation of a thread in, say,
73
- a C++ application cause object destructors and C++ exception
74
- handlers to be invoked as the stack unwinds during thread
75
- exit, or not?
76
-
77
- There seems to be more opinion in favour of using the
78
- standard C version of the library (no EH) with C++ applications
79
- since this appears to be the assumption commercial pthreads
80
- implementations make. Therefore, if you use an EH version
81
- of pthreads-win32 then you may be under the illusion that
82
- your application will be portable, when in fact it is likely to
83
- behave very differently linked with other pthreads libraries.
84
-
85
- Now you may be asking: why have you kept the EH versions of
86
- the library?
87
-
88
- There are a couple of reasons:
89
- - there is division amongst the experts and so the code may
90
- be needed in the future. (Yes, it's in the repository and we
91
- can get it out anytime in the future, but ...)
92
- - pthreads-win32 is one of the few implementations, and possibly
93
- the only freely available one, that has EH versions. It may be
94
- useful to people who want to play with or study application
95
- behaviour under these conditions.
96
-
97
-
98
- ------------------------------------------------------------------------------
99
-
100
- Q 3 What is the library naming convention?
101
- ---
102
-
103
- Because the library is being built using various exception
104
- handling schemes and compilers - and because the library
105
- may not work reliably if these are mixed in an application,
106
- each different version of the library has it's own name.
107
-
108
- Note 1: the incompatibility is really between EH implementations
109
- of the different compilers. It should be possible to use the
110
- standard C version from either compiler with C++ applications
111
- built with a different compiler. If you use an EH version of
112
- the library, then you must use the same compiler for the
113
- application. This is another complication and dependency that
114
- can be avoided by using only the standard C library version.
115
-
116
- Note 2: if you use a standard C pthread*.dll with a C++
117
- application, then any functions that you define that are
118
- intended to be called via pthread_cleanup_push() must be
119
- __cdecl.
120
-
121
- Note 3: the intention is to also name either the VC or GC
122
- version (it should be arbitrary) as pthread.dll, including
123
- pthread.lib and libpthread.a as appropriate.
124
-
125
- In general:
126
- pthread[VG]{SE,CE,C}.dll
127
- pthread[VG]{SE,CE,C}.lib
128
-
129
- where:
130
- [VG] indicates the compiler
131
- V - MS VC
132
- G - GNU C
133
-
134
- {SE,CE,C} indicates the exception handling scheme
135
- SE - Structured EH
136
- CE - C++ EH
137
- C - no exceptions - uses setjmp/longjmp
138
-
139
- For example:
140
- pthreadVSE.dll (MSVC/SEH)
141
- pthreadGCE.dll (GNUC/C++ EH)
142
- pthreadGC.dll (GNUC/not dependent on exceptions)
143
-
144
- The GNU library archive file names have changed to:
145
-
146
- libpthreadGCE.a
147
- libpthreadGC.a
148
-
149
-
150
- ------------------------------------------------------------------------------
151
-
152
- Q 4 Cleanup code default style or: it used to work when I built
153
- --- the library myself, but now it doesn't - why?
154
-
155
- Up to and including snapshot 2001-07-12, if not defined, the cleanup
156
- style was determined automatically from the compiler used, and one
157
- of the following was defined accordingly:
158
-
159
- __CLEANUP_SEH MSVC only
160
- __CLEANUP_CXX C++, including MSVC++, GNU G++
161
- __CLEANUP_C C, including GNU GCC, not MSVC
162
-
163
- These defines determine the style of cleanup (see pthread.h) and,
164
- most importantly, the way that cancelation and thread exit (via
165
- pthread_exit) is performed (see the routine ptw32_throw() in private.c).
166
-
167
- In short, the exceptions versions of the library throw an exception
168
- when a thread is canceled or exits (via pthread_exit()), which is
169
- caught by a handler in the thread startup routine, so that the
170
- the correct stack unwinding occurs regardless of where the thread
171
- is when it's canceled or exits via pthread_exit().
172
-
173
- After snapshot 2001-07-12, unless your build explicitly defines (e.g.
174
- via a compiler option) __CLEANUP_SEH, __CLEANUP_CXX, or __CLEANUP_C, then
175
- the build now ALWAYS defaults to __CLEANUP_C style cleanup. This style
176
- uses setjmp/longjmp in the cancelation and pthread_exit implementations,
177
- and therefore won't do stack unwinding even when linked to applications
178
- that have it (e.g. C++ apps). This is for consistency with most/all
179
- commercial Unix POSIX threads implementations.
180
-
181
- Although it was not clearly documented before, it is still necessary to
182
- build your application using the same __CLEANUP_* define as was
183
- used for the version of the library that you link with, so that the
184
- correct parts of pthread.h are included. That is, the possible
185
- defines require the following library versions:
186
-
187
- __CLEANUP_SEH pthreadVSE.dll
188
- __CLEANUP_CXX pthreadVCE.dll or pthreadGCE.dll
189
- __CLEANUP_C pthreadVC.dll or pthreadGC.dll
190
-
191
- THE POINT OF ALL THIS IS: if you have not been defining one of these
192
- explicitly, then the defaults have been set according to the compiler
193
- and language you are using, as described at the top of this
194
- section.
195
-
196
- THIS NOW CHANGES, as has been explained above. For example:
197
-
198
- If you were building your application with MSVC++ i.e. using C++
199
- exceptions (rather than SEH) and not explicitly defining one of
200
- __CLEANUP_*, then __CLEANUP_C++ was defined for you in pthread.h.
201
- You should have been linking with pthreadVCE.dll, which does
202
- stack unwinding.
203
-
204
- If you now build your application as you had before, pthread.h will now
205
- set __CLEANUP_C as the default style, and you will need to link
206
- with pthreadVC.dll. Stack unwinding will now NOT occur when a
207
- thread is canceled, nor when the thread calls pthread_exit().
208
-
209
- Your application will now most likely behave differently to previous
210
- versions, and in non-obvious ways. Most likely is that local
211
- objects may not be destroyed or cleaned up after a thread
212
- is canceled.
213
-
214
- If you want the same behaviour as before, then you must now define
215
- __CLEANUP_C++ explicitly using a compiler option and link with
216
- pthreadVCE.dll as you did before.
217
-
218
-
219
- ------------------------------------------------------------------------------
220
-
221
- Q 5 Why is the default library version now less exception-friendly?
222
- ---
223
-
224
- Because most commercial Unix POSIX threads implementations don't allow you to
225
- choose to have stack unwinding. (Compaq's TRU64 Unix is possibly an exception.)
226
-
227
- Therefore, providing it in pthread-win32 as a default could be dangerous
228
- and non-portable. We still provide the choice but you must now consciously
229
- make it.
230
-
231
- WHY NOT REMOVE THE EXCEPTIONS VERSIONS OF THE LIBRARY ALTOGETHER?
232
- There are a few reasons:
233
- - because there are well respected POSIX threads people who believe
234
- that POSIX threads implementations should be exceptions-aware and
235
- do the expected thing in that context. (There are equally respected
236
- people who believe it should not be easily accessible, if it's there
237
- at all.)
238
- - because pthreads-win32 is one of the few implementations that has
239
- the choice, perhaps the only freely available one, and so offers
240
- a laboratory to people who may want to explore the effects;
241
- - although the code will always be around somewhere for anyone who
242
- wants it, once it's removed from the current version it will not be
243
- nearly as visible to people who may have a use for it.
244
-
245
-
246
- ------------------------------------------------------------------------------
247
-
248
- Q 6 Should I use Cygwin or Mingw32 as a development environment?
249
- ---
250
-
251
- Important: see Q7 also.
252
-
253
- Use Mingw32 with the MSVCRT library to build applications that use
254
- the pthreads DLL.
255
-
256
- Cygwin's own internal support for POSIX threads is growing.
257
- Consult that project's documentation for more information.
258
-
259
- ------------------------------------------------------------------------------
260
-
261
- Q 7 Now that pthreads-win32 builds under Mingw32, why do I get
262
- --- memory access violations (segfaults)?
263
-
264
- The latest Mingw32 package has thread-safe exception handling (see Q10).
265
- Also, see Q6 above.
266
-
267
- ------------------------------------------------------------------------------
268
-
269
- Q 8 How do I use pthread.dll for Win32 (Visual C++ 5.0)
270
- ---
271
-
272
- >
273
- > I'm a "rookie" when it comes to your pthread implementation. I'm currently
274
- > desperately trying to install the prebuilt .dll file into my MSVC compiler.
275
- > Could you please provide me with explicit instructions on how to do this (or
276
- > direct me to a resource(s) where I can acquire such information)?
277
- >
278
- > Thank you,
279
- >
280
-
281
- You should have a .dll, .lib, .def, and three .h files. It is recommended
282
- that you use pthreadVC.dll, rather than pthreadVCE.dll or pthreadVSE.dll
283
- (see Q2 above).
284
-
285
- The .dll can go in any directory listed in your PATH environment
286
- variable, so putting it into C:\WINDOWS should work.
287
-
288
- The .lib file can go in any directory listed in your LIB environment
289
- variable.
290
-
291
- The .h files can go in any directory listed in your INCLUDE
292
- environment variable.
293
-
294
- Or you might prefer to put the .lib and .h files into a new directory
295
- and add its path to LIB and INCLUDE. You can probably do this easiest
296
- by editing the file:-
297
-
298
- C:\Program Files\DevStudio\vc\bin\vcvars32.bat
299
-
300
- The .def file isn't used by anything in the pre-compiled version but
301
- is included for information.
302
-
303
- Cheers.
304
- Ross
305
-
306
- ------------------------------------------------------------------------------
307
-
308
- Q 9 Cancelation doesn't work for me, why?
309
- ---
310
-
311
- > I'm investigating a problem regarding thread cancelation. The thread I want
312
- > to cancel has PTHREAD_CANCEL_ASYNCHRONOUS, however, this piece of code
313
- > blocks on the join():
314
- >
315
- > if ((retv = Pthread_cancel( recvThread )) == 0)
316
- > {
317
- > retv = Pthread_join( recvThread, 0 );
318
- > }
319
- >
320
- > Pthread_* are just macro's; they call pthread_*.
321
- >
322
- > The thread recvThread seems to block on a select() call. It doesn't get
323
- > cancelled.
324
- >
325
- > Two questions:
326
- >
327
- > 1) is this normal behaviour?
328
- >
329
- > 2) if not, how does the cancel mechanism work? I'm not very familliar to
330
- > win32 programming, so I don't really understand how the *Event() family of
331
- > calls work.
332
-
333
- The answer to your first question is, normal POSIX behaviour would
334
- be to asynchronously cancel the thread. However, even that doesn't
335
- guarantee cancelation as the standard only says it should be
336
- cancelled as soon as possible.
337
-
338
- Snapshot 99-11-02 or earlier only partially supports asynchronous cancellation.
339
- Snapshots since then simulate async cancelation by poking the address of
340
- a cancelation routine into the PC of the threads context. This requires
341
- the thread to be resumed in some way for the cancelation to actually
342
- proceed. This is not true async cancelation, but it is as close as we've
343
- been able to get to it.
344
-
345
- If the thread you're trying to cancel is blocked (for instance, it could be
346
- waiting for data from the network), it will only get cancelled when it unblocks
347
- (when the data arrives). For true pre-emptive cancelation in these cases,
348
- pthreads-win32 from snapshot 2004-05-16 can automatically recognise and use the
349
- QueueUserAPCEx package by Panagiotis E. Hadjidoukas. This package is available
350
- from the pthreads-win32 ftp site and is included in the pthreads-win32
351
- self-unpacking zip from 2004-05-16 onwards.
352
-
353
- Using deferred cancelation would normally be the way to go, however,
354
- even though the POSIX threads standard lists a number of C library
355
- functions that are defined as deferred cancelation points, there is
356
- no hookup between those which are provided by Windows and the
357
- pthreads-win32 library.
358
-
359
- Incidently, it's worth noting for code portability that the older POSIX
360
- threads standards cancelation point lists didn't include "select" because
361
- (as I read in Butenhof) it wasn't part of POSIX. However, it does appear in
362
- the SUSV3.
363
-
364
- Effectively, the only mandatory cancelation points that pthreads-win32
365
- recognises are those the library implements itself, ie.
366
-
367
- pthread_testcancel
368
- pthread_cond_wait
369
- pthread_cond_timedwait
370
- pthread_join
371
- sem_wait
372
- sem_timedwait
373
- pthread_delay_np
374
-
375
- The following routines from the non-mandatory list in SUSV3 are
376
- cancelation points in pthreads-win32:
377
-
378
- pthread_rwlock_wrlock
379
- pthread_rwlock_timedwrlock
380
-
381
- The following routines from the non-mandatory list in SUSV3 are not
382
- cancelation points in pthreads-win32:
383
-
384
- pthread_rwlock_rdlock
385
- pthread_rwlock_timedrdlock
386
-
387
- Pthreads-win32 also provides two functions that allow you to create
388
- cancelation points within your application, but only for cases where
389
- a thread is going to block on a Win32 handle. These are:
390
-
391
- pthreadCancelableWait(HANDLE waitHandle) /* Infinite wait */
392
-
393
- pthreadCancelableTimedWait(HANDLE waitHandle, DWORD timeout)
394
-
395
- ------------------------------------------------------------------------------
396
-
397
-
398
- Q 10 How do I create thread-safe applications using
399
- ---- pthreadGCE.dll, libpthreadw32.a and Mingw32?
400
-
401
- This should not be a problem with recent versions of MinGW32.
402
-
403
- For early versions, see Thomas Pfaff's email at:
404
- http://sources.redhat.com/ml/pthreads-win32/2002/msg00000.html
405
- ------------------------------------------------------------------------------
406
-
407
- Q 11 Why isn't pthread_t defined as a scalar (e.g. pointer or int)
408
- like it is for other POSIX threads implementations?
409
- ----
410
-
411
- Originally pthread_t was defined as a pointer (to the opaque pthread_t_
412
- struct) and later it was changed to a struct containing the original
413
- pointer plus a sequence counter. This is allowed under both the original
414
- POSIX Threads Standard and the current Single Unix Specification.
415
-
416
- When pthread_t is a simple pointer to a struct some very difficult to
417
- debug problems arise from the process of freeing and later allocing
418
- thread structs because new pthread_t handles can acquire the identity of
419
- previously detached threads. The change to a struct was made, along with
420
- some changes to their internal managment, in order to guarantee (for
421
- practical applications) that the pthread_t handle will be unique over the
422
- life of the running process.
423
-
424
- Where application code attempts to compare one pthread_t against another
425
- directly, a compiler error will be emitted because structs can't be
426
- compared at that level. This should signal a potentially serious problem
427
- in the code design, which would go undetected if pthread_t was a scalar.
428
-
429
- The POSIX Threading API provides a function named pthread_equal() to
430
- compare pthread_t thread handles.
431
-
432
- Other pthreads implementations, such as Sun's, use an int as the handle
433
- but do guarantee uniqueness within the process scope. Win32 scalar typed
434
- thread handles also guarantee uniqueness in system scope. It wasn't clear
435
- how well the internal management of these handles would scale as the
436
- number of threads and the fragmentation of the sequence numbering
437
- increased for applications where thousands or millions of threads are
438
- created and detached over time. The current management of threads within
439
- pthreads-win32 using structs for pthread_t, and reusing without ever
440
- freeing them, reduces the management time overheads to a constant, which
441
- could be important given that pthreads-win32 threads are built on top of
442
- Win32 threads and will therefore include that management overhead on top
443
- of their own. The cost is that the memory resources used for thread
444
- handles will remain at the peak level until the process exits.
445
-
446
- While it may be inconvenient for developers to be forced away from making
447
- assumptions about the internals of pthread_t, the advantage for the
448
- future development of pthread-win32, as well as those applications that
449
- use it and other pthread implementations, is that the library is free to
450
- change pthread_t internals and management as better methods arise.
451
-