The bits of the IT world that apply to me right now. Blogged in the hope that someone (even me) will find them useful.
Showing posts with label Perl. Show all posts
Showing posts with label Perl. Show all posts
Wednesday, April 30, 2008
Perl Best Practices, live!
Whack your dodgey Perl code in here and get the the bad news right away!
Labels:
code,
lint,
Perl,
Perl Best Practice,
programming
Monday, February 18, 2008
Perl threads :-(
I chucked in an entry for the Computer languages shootout game for the Perl implementation of a thread-ring. I've a few observations:
I'm going to see if libevent holds any hope for me. If not, then maybe a mass of file handles, and select statements...
- My application relies on semaphores that unblock themselves quickly. On average, there's two threads running (rather than blocking on a semaphore) at a time, but my dual core PC is only 60-80% utilised. Something in the cond_wait implementation is sleeping.
- Try as I might, semaphores were the only IPC mechanism I could get to work in a way that appeared "correct" (rather than spurious errors about shared or locked, or whatever). This may be a reflection on the workman rather than his tools.
- Getting any cross-platform, efficient, thread-safe, IPC across muliple versions of Perl, is like pulling teeth. I've got a blended semaphore-based implementation ready to go. By blended, I mean it uses (inefficient) semaphores for the tricky first lap around the ring (ensuring that all initialisation is done correctly), and then move over to "something" immediate for message passing. I need a working message passing implementation to slot in now.
- As the shootout game demonstrates, Perl threads are not even close to universally available in any sense of the term.
I'm going to see if libevent holds any hope for me. If not, then maybe a mass of file handles, and select statements...
Labels:
Debian,
multi-threaded,
Perl,
progamming,
semaphores,
threads
Subscribe to:
Posts (Atom)