in reply to Re^4: Using Perl to run a Windows command-line utility many times with ordered, parallel execution
in thread Using Perl to run a Windows command-line utility many times with ordered, parallel execution
What about Thread::Queue::MaxSize?
Honestly?
If you're not the author, read on:
What a mess!
Queues are (should be) reliable, ordered and efficient, sync-free buffers between producer and consumer threads.
Now the programmer has to both remember what the limit is, and check it before every enqueue.
Like having a dog and barking yourself. Completely pointless.
The whole point of a self limiting queue is to provide a self-checking, buffer between producers and consumers that automatically restrains over active producers.
Can you imagine using a supermarket checkout that random threw items of the current customer into a bin, whenever a new customer miscounted the belt limit and added their items to the end?
The ability to insert and delete items into/from the middle of a queue totally violates the design contracts of a 'queue'.
This is why I rejected patching or modifying Thread::Queue. Because the new owner rendered the module inefficient and corrupt when he added those facilities to the original authors correct and efficient implementation. For no good reason beyond 'making his mark'.
If configuration constants make sense, the module should provide proper constants.
the module should convert them to all upper or all lower on input so that from then on they can be compared directly against hard-coded strings with eq thus avoiding the not inconsequential costs of invoking the regex engine over and over to perform case-insensitive comparisons.
In summary: a very bad design, horribly naively implemented. It typifies everything that is wrong with CPAN!
If you are the author. Sorry.
|
|---|