| 1 |
0.35 9 November 2019 |
| 2 |
Adoption |
| 3 |
|
| 4 |
0.33 20 September 2010 |
| 5 |
Checking the tool chain with perl5.13.5. Fixed some tests that were |
| 6 |
failing because of Test::Harness not being able to cope with threaded |
| 7 |
tests and some issues with pickyness of newer executors. |
| 8 |
|
| 9 |
28 January 2004 |
| 10 |
Made sure the test-suite cleans up on multi-versioned systems. |
| 11 |
|
| 12 |
0.32 28 December 2003 |
| 13 |
Added automatic required modules update using Devel::Required. |
| 14 |
|
| 15 |
0.31 17 November 2003 |
| 16 |
Added method "result_any" to fetch _any_ result, optionally setting |
| 17 |
the jobid as well. After a suggestion by Matthew Kirkwood. |
| 18 |
|
| 19 |
0.30 9 November 2003 |
| 20 |
Increased dependency on Thread::Conveyor to 0.15 because of problem |
| 21 |
fix for 5.8.2. |
| 22 |
|
| 23 |
3 October 2003 |
| 24 |
Found still one reference to original name threads::farm in the POD. |
| 25 |
Now removed. |
| 26 |
|
| 27 |
0.29 11 August 2003 |
| 28 |
Cleaned Makefile.PL and upgraded dependencies and copyright. |
| 29 |
|
| 30 |
Fixed test-suite so it runs cleanly under warnings. Added special |
| 31 |
__WARN__ handler to tell where any warning came from. Fixed a problem |
| 32 |
in Thread::Pool->new with an undefined "maxjobs" setting. |
| 33 |
|
| 34 |
0.28 30 September 2002 |
| 35 |
Use "load.pm" instead of AutoLoader. Increased dependency on |
| 36 |
Thread::Conveyor and T::C::Monitored, which also use "load.pm" now. |
| 37 |
|
| 38 |
Removed "our" from $VERSION, should shave off some bytes in |
| 39 |
memory usage, as found from testing with Benchmark::Thread::Size. |
| 40 |
|
| 41 |
22 September 2002 |
| 42 |
Removed some blurb about Thread::Tie. Made internal use of |
| 43 |
Thread::Tie unconditional, as Thread::Tie will always be loaded |
| 44 |
because of Thread::Conveyor. Spotted by Chris Rosebrugh. |
| 45 |
|
| 46 |
0.27 1 September 2002 |
| 47 |
Increased dependency on Thread::Conveyor to 0.10, to ensure we have |
| 48 |
the latest and the best. |
| 49 |
|
| 50 |
Adapted test-suite to account correctly for the extra thread that is |
| 51 |
created by the new dependency of Thread::Conveyor on Thread::Tie. |
| 52 |
|
| 53 |
0.26 30 August 2002 |
| 54 |
Changed all modules to use AutoLoader to defer loading of necessary |
| 55 |
subroutines to when they are actually needed. This should save |
| 56 |
memory and CPU for larger programs, or with large numbers of threads. |
| 57 |
The test-suite only marginally takes more memory and uses 10% less CPU: |
| 58 |
overhead of compiling is levelled out with the overhead of cloning |
| 59 |
pre-compiled routines. |
| 60 |
|
| 61 |
0.25 27 August 2002 |
| 62 |
Added support for checkpointing on the monitor thread + documentation |
| 63 |
+ adaptation of the test-suite. |
| 64 |
|
| 65 |
Raised dependency on Thread::Conveyor::Monitored to take advantage of |
| 66 |
the new checkpointing feature. |
| 67 |
|
| 68 |
0.24 14 August 2002 |
| 69 |
Raised dependency on Thread::Conveyor again to take advantage of |
| 70 |
possible problem fix. |
| 71 |
|
| 72 |
13 August 2002 |
| 73 |
Reduced number of tests in test-suite for the hammering bits: it |
| 74 |
was taking about 30 minutes on my development machine, which is |
| 75 |
really too much. |
| 76 |
|
| 77 |
Now uses Thread::Serialize::(freeze|thaw) for serialization of |
| 78 |
data structures between threads. Raised dependency on |
| 79 |
Thread::Conveyor to make sure this always works. |
| 80 |
|
| 81 |
Added support for Thread::Tie: the workers array will use the |
| 82 |
Thread::Tie implementation if it is available. This to avoid the |
| 83 |
memory leak with shared arrays. |
| 84 |
|
| 85 |
0.23 7 August 2002 |
| 86 |
Added documentation for the "optimize" field (in "new") and method. |
| 87 |
Thread::Pool now has its own default setting for optimization. |
| 88 |
|
| 89 |
Adapted writeup of "abort", it now is _the_ way of temporarily |
| 90 |
shutting down a pool from which it is possible to recover later |
| 91 |
by adding workers again. |
| 92 |
|
| 93 |
Finally migrated the complete test-suite: now 1230 tests which take |
| 94 |
almost 30 minutes on my development box. |
| 95 |
|
| 96 |
6 August 2002 |
| 97 |
Continued with migration. Unfortunately, it has become impossible |
| 98 |
to recover from a shutdown. Documentation has been adapted to |
| 99 |
reflect this change, as well as the test-suite. This also fixed |
| 100 |
some problems that may have occurred in the test-suite on faster |
| 101 |
machines. |
| 102 |
|
| 103 |
5 August 2002 |
| 104 |
Started with migration to new Thread::Conveyor functionality. |
| 105 |
Adapted requirements in Makefile.PL. On towards a Thread::Pool and |
| 106 |
Thread::Pool::Resolve that doesn't eat memory like crazy. |
| 107 |
|
| 108 |
0.22 1 August 2002 |
| 109 |
Fixed problem in random access test-suite that would fail only on |
| 110 |
faster machines. |
| 111 |
|
| 112 |
Increased Makefile.PL dependencies for Thread::Conveyor and |
| 113 |
Thread::Conveyor::Monitored. |
| 114 |
|
| 115 |
Added support for throttling Conveyor belts. Removed local |
| 116 |
throttling support, as it now uses the throttling support of |
| 117 |
Thread::Conveyor. This means that now monitoring belts will |
| 118 |
be throttled the same way as the job belt (they were not throttled |
| 119 |
before). |
| 120 |
|
| 121 |
0.21 29 July 2002 |
| 122 |
Hopefully fixed the last deadlock issues with regards to job |
| 123 |
throttling. Thread::Pool::Resolve finally gets through its test-suite |
| 124 |
always. |
| 125 |
|
| 126 |
0.20 26 July 2002 |
| 127 |
Fixed some documentation nits. |
| 128 |
|
| 129 |
Removed autoshutdown resetting hack in dispatcher routines: not needed |
| 130 |
anymore because of the CLONE check. |
| 131 |
|
| 132 |
25 July 2002 |
| 133 |
Added "maxjobs" and "minjobs" methods, so that job throttling can be |
| 134 |
adapted on the fly. Added documentation and adapted test-suite. |
| 135 |
|
| 136 |
Added support for the "pre_post_monitor_only" field, which allows the |
| 137 |
"pre" and "post" routine to only be executed for the "monitor" routine. |
| 138 |
Added tests and documentation for it also. |
| 139 |
|
| 140 |
Removed conditional Thread::Conveyor::Monitored loading code. Since |
| 141 |
Thread::Conveyor::Monitored is a prerequisite now, it was not necessary |
| 142 |
anymore. |
| 143 |
|
| 144 |
0.19 25 July 2002 |
| 145 |
Made $VERSION have the : unique attribute to save memory. |
| 146 |
|
| 147 |
Removed stray "use Carp" that was left behind from some debugging. |
| 148 |
Rearranged -use-s to minimize what is really needed exactly. Adapted |
| 149 |
Makefile.PL to now also depend on Thread::Conveyor::Monitored. |
| 150 |
|
| 151 |
Fixed problem in "shutdown" which would sometimes put too many stop |
| 152 |
requests on the job belt. With the new belt->peek_dontwait method |
| 153 |
any remaining stop requests are removed from the belt. This should |
| 154 |
fix test-suite errors that occurred only on some systems. |
| 155 |
|
| 156 |
Now depends on both Thread::Conveyor and Thread::Conveyor::Monitored |
| 157 |
instead of Thread::Queue::Any and Thread::Queue::Any::Monitored. |
| 158 |
Changed metaphor from queue to belt in the documentation and the |
| 159 |
test-suite. |
| 160 |
|
| 161 |
24 July 2002 |
| 162 |
Added a more elaborate example for log resolving, which is the base |
| 163 |
code for the new Thread::Pool::Resolve module. |
| 164 |
|
| 165 |
0.18 23 July 2002 |
| 166 |
Finally (hopefully) fixed problems with deadlocking. It seems that |
| 167 |
accessing unlocked shared arrays and hashes may cause deadlocking |
| 168 |
issues also because locks are happening at the C-level. Will |
| 169 |
investigate later. Job throttling now considered beta. |
| 170 |
|
| 171 |
0.17 22 July 2002 |
| 172 |
Added support for job throttling by the "maxjobs" and "minjobs" field |
| 173 |
in the "new" method. Adapted the "_random" and "_stream" dispatchers |
| 174 |
as well as the "job" method. Added test-suite for this as well. |
| 175 |
This code is really still alpha, it does not seem to get through the |
| 176 |
test always, so there could still be some deadlocking issues here. |
| 177 |
|
| 178 |
Added method "results". Returns the job IDs of which there are still |
| 179 |
results ready to be fetched. Returns the number of results in scalar |
| 180 |
context. |
| 181 |
|
| 182 |
Added class method "monitor" that returns the |
| 183 |
Thread::Queue::Any::Monitored object associated with the pool in the |
| 184 |
"do", "pre" and "post" routine if monitoring. |
| 185 |
|
| 186 |
Changed rogue DESTROY hack to use UNIVERSAL::isa(). Suggested by |
| 187 |
Ken Williams. |
| 188 |
|
| 189 |
Added the first full blown example: a simple log resolving filter. |
| 190 |
|
| 191 |
Removed some "originatingthreadid" cruft that was left behind. Also |
| 192 |
removed some "destroyed" cruft. |
| 193 |
|
| 194 |
Simplified the rogue DESTROY test hack. |
| 195 |
|
| 196 |
0.16 21 July 2002 |
| 197 |
Added test-case for testing all of the methods that can be called. |
| 198 |
Completed the multi-thread job submission test. |
| 199 |
|
| 200 |
Changed DESTROY to only do something when in the originating thread. |
| 201 |
Found bug in 5.8.0 that is calling DESTROY just too many times. Found |
| 202 |
a way around that by using the CLONE subroutine. This fixes the |
| 203 |
segfaults that I have been seeing, that I realize now, were caused |
| 204 |
by the extra DESTROYs. |
| 205 |
|
| 206 |
20 July 2002 |
| 207 |
Started the multi-thread job-submitter test-suite. Ran into |
| 208 |
segfaults. Trying to reproduce them in a simpler example now. |
| 209 |
|
| 210 |
0.15 19 July 2002 |
| 211 |
Also fixed "abort" functionality in case there weren't any jobs to |
| 212 |
do anymore: the worker threads would be blocked on reading the job |
| 213 |
queue and not see the abort flag. Now, the remaining threads are |
| 214 |
signalled to stop the ordinary way. |
| 215 |
|
| 216 |
Added test-suite for "abort" functionality. Added internal routine |
| 217 |
"_first_todo_jobid" which allows "shutdown" to only stream results |
| 218 |
of jobs actually done, rather then to try to stream results that |
| 219 |
weren't created yet. This should fix the "abort" functionality. |
| 220 |
|
| 221 |
Renamed internal routine "_freeze" to "set_result" and exposed it to |
| 222 |
the world as part of the "jobid" and "dont_set_result" combo. This |
| 223 |
should now allow the development of the completely asynchronous log |
| 224 |
resolve module I was thinking about, where lookups on the same IP |
| 225 |
number will be handled by a single thread rather than by any thread |
| 226 |
that just happens to get the IP-number. |
| 227 |
|
| 228 |
Removed internal routine "_thaw": all thawing internally is done by |
| 229 |
calling Storable directly for speed, so it was dead wood. |
| 230 |
|
| 231 |
Added "jobid" and "dont_set_result" methods to allow "do" subroutines |
| 232 |
to have other threads create the result of the current thread. Adapted |
| 233 |
the _random and _stream dispatcher to honour these new methods. |
| 234 |
|
| 235 |
Simplified the "remove_me" functionality by a simple lexical flag |
| 236 |
rather than having to use the object. This now also makes it a |
| 237 |
class method. |
| 238 |
|
| 239 |
Fixed several minor pod nits. Removed some Carp cruft from the |
| 240 |
test-suite. |
| 241 |
|
| 242 |
0.14 18 July 2002 |
| 243 |
Fixed problem with monitoring a thread that was't finished when |
| 244 |
shutdown time was encountered. |
| 245 |
|
| 246 |
Added support for the new "post" routine in |
| 247 |
Thread::Queue::Any::Monitored in "new" and "add". Needed so that |
| 248 |
e.g. file handles are closed and buffers flushed. |
| 249 |
|
| 250 |
Small performance improvement in "add" if more than one thread is |
| 251 |
added: original input parameters are only thawed once. |
| 252 |
|
| 253 |
Moved shutting down of monitoring thread from DESTROY back to |
| 254 |
"shutdown". This makes more sense. Added code to restart the |
| 255 |
monitoring thread if necessary in "add". |
| 256 |
|
| 257 |
Found one problem remaining in shutdown that caused the errors I |
| 258 |
was seeing yesterday. I guess 13 _was_ an unlucky number. |
| 259 |
Re-instated the full test-suite now. |
| 260 |
|
| 261 |
0.13 17 July 2002 |
| 262 |
Testing on large numbers of threads and/or jobs keeps failing |
| 263 |
indeterminately. Lowered the number of tests to be able to get |
| 264 |
the module out there for testing on other machines. |
| 265 |
|
| 266 |
No longer passes the Thread::Pool object to the "do", "pre" and |
| 267 |
"post" routine. This to conform to the way Thread::Queue::Monitored |
| 268 |
works. If the object is needed, the "self" class method should be |
| 269 |
called. This change should also speed up things a bit. |
| 270 |
|
| 271 |
Added class method "self" for use within the "pre", "do", "post", |
| 272 |
"stream" or "monitor" routine. It returns the object they're |
| 273 |
working for. |
| 274 |
|
| 275 |
The same "pre" routine is now also passed to the internal "monitor" |
| 276 |
object. If you really want to have a different "pre" routine, then |
| 277 |
you can create a seperate Thread::Queue::Any::Monitored object and |
| 278 |
use a "stream" routine to fill that monitored queue. |
| 279 |
|
| 280 |
Changed the functionality of the "pre" routine to not save any |
| 281 |
of the returned values. It makes much more sense for the "pre" |
| 282 |
routine to set either lexical or global variables that would be |
| 283 |
automatically accessible to the "do" and "post" routine by virtue |
| 284 |
of the fact that they have their own memory space to play with. |
| 285 |
Adapted the test-suite accordingly. |
| 286 |
|
| 287 |
Added support for "monitor" keyword in "new" method. Allows you to |
| 288 |
specify a streaming mode in which the stream is handled by a single |
| 289 |
monitoring thread rather than by each thread themselves. Courtesy |
| 290 |
of the new Thread::Queue::Any::Monitored module. |
| 291 |
|
| 292 |
Fixed problem with warning being issued when starting the object. |
| 293 |
Caused by the originating thread id value not being set for the |
| 294 |
originating thread itself. |
| 295 |
|
| 296 |
0.12 16 July 2002 |
| 297 |
Added method "waitfor" as a shortcut for using "job" and "result". |
| 298 |
|
| 299 |
Moved checks for originating thread to new internal method |
| 300 |
_check_originating_thread. |
| 301 |
|
| 302 |
Added method "abort" to have all the worker threads stop after they're |
| 303 |
finished with their current job. Adapted new, _random and _stream |
| 304 |
for this new feature. |
| 305 |
|
| 306 |
0.11 15 July 2002 |
| 307 |
Bumped up version to 0.11 to be higher than Malcolm Beattie's original |
| 308 |
Thread::Pool module on CPAN. No other changes were made. |
| 309 |
|
| 310 |
0.04 15 July 2002 |
| 311 |
Hopefully fixed problem in streaming caused by some stupid thread |
| 312 |
inertia problem. Problem was caused by the dispatcher assigning the |
| 313 |
jobid rather than the "job" method. Things could get out of sync |
| 314 |
before the dispatcher was reached. |
| 315 |
|
| 316 |
Added "join" method to allow intermediate cleanup of removed worker |
| 317 |
threads. Fixed up "shutdown" to call "join". |
| 318 |
|
| 319 |
Internally changed dispatcher system: there are now different |
| 320 |
dispatchers for streaming and random access mode. |
| 321 |
|
| 322 |
Method "done" now only counts jobs by removed threads. Job counts |
| 323 |
are now kept in local thread space and only made shared when the |
| 324 |
worker thread is removed. |
| 325 |
|
| 326 |
Gone back to not detaching threads. Detached threads cannot be |
| 327 |
waited for, which is a major PITA. |
| 328 |
|
| 329 |
0.03 14 July 2002 |
| 330 |
Made sure that once the pool is shut down, calling method "shutdown" |
| 331 |
again will not do anything. At least not until method "add" is |
| 332 |
called. This should fix the situation where the pool is specifically |
| 333 |
shut down, and again shut down when the object is destroyed. |
| 334 |
|
| 335 |
Added method "notused" which returns the number of threads that |
| 336 |
were removed before they got a chance to do anything. Can be used |
| 337 |
to give you a heuristic of how many threads you actually need for a |
| 338 |
specific application. |
| 339 |
|
| 340 |
Added functionality for streaming results. This allows you to |
| 341 |
specify a "stream" subroutine that allows you to handle the result |
| 342 |
of the asynchronously executed "do" subroutines in the order in |
| 343 |
which the jobs were submitted (rather than in the order in which the |
| 344 |
results were obtained). |
| 345 |
|
| 346 |
Added "remove_me" functionality, which allows a "do" routine to tell |
| 347 |
its dispatcher that the worker thread should be removed. |
| 348 |
|
| 349 |
Added Perl version requirement to README and pod, per suggestion of |
| 350 |
mrbbking. Added -use threads- to Makefile.PL to cause breakage of |
| 351 |
the install process if threads are not available. |
| 352 |
|
| 353 |
Added specific check for named subroutine reference. The old |
| 354 |
Thread::Pool module from CPAN also allowed this. |
| 355 |
|
| 356 |
0.02 13 July 2002 |
| 357 |
Added initial version of test-suite. |
| 358 |
|
| 359 |
Added initial version of the documentation. |
| 360 |
|
| 361 |
Added copyright info to pod. |
| 362 |
|
| 363 |
Name change threads::shared:: -> Thread:: caused this module to be |
| 364 |
renamed to the Thread:: namespace. Per Dan Sugalski's suggestion, |
| 365 |
the name became Thread::Pool. |
| 366 |
|
| 367 |
Dave Rolsky suggested that "hire" and "fire" were too cutesy. And I |
| 368 |
figured that "fire" could be misinterpreted as "fire up a thread" |
| 369 |
rather than retire. Therefore the following changes were made: |
| 370 |
|
| 371 |
hire -> add |
| 372 |
fire -> remove |
| 373 |
fired -> removed |
| 374 |
hired (deleted, moved functionality to "workers") |
| 375 |
|
| 376 |
I also changed "result_nb" to "result_dontwait", as that is a better |
| 377 |
description of what it does (who knows that "nb" stands for |
| 378 |
"non-blocking" and then knows what it means?). |
| 379 |
|
| 380 |
0.01 12 July 2002 |
| 381 |
First version as threads::farm. |