![]() |
|
Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Threads or no Threads (Threading and Concurrency References)by eyepopslikeamosquito (Bishop) |
on Feb 24, 2007 at 09:12 UTC ( #601860=note: print w/replies, xml ) | Need Help?? |
In case it's of use, I wrote a couple of scripts to run a command, killing it if it took more than a specified timeout, and reporting how long it took to run:
Update: Using this node nowadays for links on Threading and Concurrency. Perl Documentation
CPAN Perl monk marioroy has produced some excellent CPAN modules in this domain:
See also:
Event-driven Programming Event-driven programming is an attractive alternative to threads, especially when using scripting languages. For Perl, there is:
See also:
As noted by marioroy, chunking complements event-driven programming. See also: event-driven references in the Wikipedia References section below. Some further chunking examples from marioroy:
Some Perl Monks Threading and Concurrency Nodes
Unit Testing Concurrent Code
See the "Testing Concurrent Software References" section below for more references in this active area of research. Though I haven't used any of these tools yet, I'd be interested to hear from folks who have or who have general advice and tips on how to troubleshoot and fix complex concurrency-related bugs. In particular, I'm not aware of any Perl-based concurrent testing frameworks. In practice, the most effective, if crude, method I've found for dealing with nasty concurrency bugs is good tracing code at just the right places combined with understanding and reasoning about the code, performing experiments, and "thinking like a detective".One especially useful experiment (mentioned in Clean Code) is to add "jiggle points" at critical places in your concurrent code and have the jiggle point either do nothing, yield, or sleep for a short interval. There are more sophisticated tools available, for example IBM's ConTest, that use this approach to flush out bugs in concurrent code. Testing Concurrent Software References
Wikipedia References
See Also
Updated: Extra references added long after the original reply was made.
In Section
Seekers of Perl Wisdom
|
|