0.14 18 July 2002
Fixed problem with monitoring a thread that was't finished when
shutdown time was encountered.
Added support for the new "post" routine in
Thread::Queue::Any::Monitored in "new" and "add". Needed so that
e.g. file handles are closed and buffers flushed.
Small performance improvement in "add" if more than one thread is
added: original input parameters are only thawed once.
Moved shutting down of monitoring thread from DESTROY back to
"shutdown". This makes more sense. Added code to restart the
monitoring thread if necessary in "add".
Found one problem remaining in shutdown that caused the errors I
was seeing yesterday. I guess 13 _was_ an unlucky number.
Re-instated the full test-suite now.
0.13 17 July 2002
Testing on large numbers of threads and/or jobs keeps failing
indeterminately. Lowered the number of tests to be able to get
the module out there for testing on other machines.
No longer passes the Thread::Pool object to the "do", "pre" and
"post" routine. This to conform to the way Thread::Queue::Monitored
works. If the object is needed, the "self" class object should be
called. This change should also speed up things a bit.
Added class method "self" for use within the "pre", "do", "post",
"stream" or "monitor" routine. It returns the object they're
working for.
The same "pre" routine is now also passed to the internal "monitor"
object. If you really want to have a different "pre" routine, then
you can create a seperate Thread::Queue::Any::Monitored object and
use a "stream" routine to fill that monitored queue.
Changed the functionality of the "pre" routine to not save any
of the returned values. It makes much more sense for the "pre"
routine to set either lexical or global variables that would be
automatically accessible to the "do" and "post" routine by virtue
of the fact that they have their own memory space to play with.
Adapted the test-suite accordingly.
Added support for "monitor" keyword in "new" method. Allows you to
specify a streaming mode in which the stream is handled by a single
monitoring thread rather than by each thread themselves. Courtesy
of the new Thread::Queue::Any::Monitored module.
Fixed problem with warning being issued when starting the object.
Caused by the originating thread id value not being set for the
originating thread itself.
0.12 16 July 2002
Added method "waitfor" as a shortcut for using "job" and "result".
Moved checks for originating thread to new internal method
_check_originating_thread.
Added method "abort" to have all the worker threads stop after they're
finished with their current job. Adapted new, _random and _stream
for this new feature.
0.11 15 July 2002
Bumped up version to 0.11 to be higher than Malcolm Beattie's original
Thread::Pool module on CPAN. No other changes were made.
0.04 15 July 2002
Hopefully fixed problem in streaming caused by some stupid thread
inertia problem. Problem was caused by the dispatcher assigning the
jobid rather than the "job" method. Things could get out of sync
before the dispatcher was reached.
Added "join" method to allow intermediate cleanup of removed worker
threads. Fixed up "shutdown" to call "join".
Internally changed dispatcher system: there are now different
dispatchers for streaming and random access mode.
Method "done" now only counts jobs by removed threads. Job counts
are now kept in local thread space and only made shared when the
worker thread is removed.
Gone back to not detaching threads. Detached threads cannot be
waited for, which is a major PITA.
0.03 14 July 2002
Made sure that once the pool is shut down, calling method "shutdown"
again will not do anything. At least not until method "add" is
called. This should fix the situation where the pool is specifically
shut down, and again shut down when the object is destroyed.
Added method "notused" which returns the number of threads that
were removed before they got a chance to do anything. Can be used
to give you a heuristic of how many threads you actually need for a
specific application.
Added functionality for streaming results. This allows you to
specify a "stream" subroutine that allows you to handle the result
of the asynchronously executed "do" subroutines in the order in
which the jobs were submitted (rather than in the order in which the
results were obtained).
Added "remove_me" functionality, which allows a "do" routine to tell
its dispatcher that the worker thread should be removed.
Added Perl version requirement to README and pod, per suggestion of
mrbbking. Added -use threads- to Makefile.PL to cause breakage of
the install process if threads are not available.
Added specific check for named subroutine reference. The old
Thread::Pool module from CPAN also allowed this.
0.02 13 July 2002
Added initial version of test-suite.
Added initial version of the documentation.
Added copyright info to pod.
Name change threads::shared:: -> Thread:: caused this module to be
renamed to the Thread:: namespace. Per Dan Sugalski's suggestion,
the name became Thread::Pool.
Dave Rolsky suggested that "hire" and "fire" were too cutesy. And I
figured that "fire" could be misinterpreted as "fire up a thread"
rather than retire. Therefore the following changes were made:
hire -> add
fire -> remove
fired -> removed
hired (deleted, moved functionality to "workers")
I also changed "result_nb" to "result_dontwait", as that is a better
description of what it does (who knows that "nb" stands for
"non-blocking" and then knows what it means?).
0.01 12 July 2002
First version as threads::farm.