Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

renodino (6856)

renodino
  (email not shown publicly)
http://www.presicient.com/

Perl Contrarian & SQL fanboy.

Here's my CPAN goods. [cpan.org]

Journal of renodino (6856)

Wednesday February 28, 2007
11:22 PM

Chipping away at ithreads

[ #32535 ]
Thread::Sociable is progressing well. All the scalar, array, and hash basics work, and performance is about double threads::shared for equivalent operations up to about 4 threads (on a uniprocessor Win32 machine). At 8 threads, things start getting interesting, and 16+ threads really expose the threads::shared global lock penalty. The coming weekend's multiprocessor tests should provide even more interesting benchmark results.

Locking tends to equalize performance for a single shared/sociable operation inside the lock scope...but the perfomance delta rapidly improves with each additional operation inside the lock.

Once the embedded queueing implementation is complete, and Thread::Apartment is updated, apartment threaded method calls should be much snappier.

The addition of a tie-like capability (required to complete Tk::Threaded) will enable some intriguing applications: when thread A writes to a sociably tied scalar, threads B, C, D, etc. can all fire their own STORE() methods. What a multithreaded FETCH() means remains a bit of a puzzler (some sort of sequencing interface is needed so thread A can decide which of thread B, C, and D's FETCH() ultimately gets applied ...)

Some additional observations:

  • the resulting XS code could make a nice template for an equivalent mapping to IPC shared memory, assuming a decent shared memory heap manager can be found (no more Storable freeze/thaw overhead!) (but will require a IPC equivalent for ithreads mutex implementation).
  • ditto for memcached ?
  • while I'm an STM skeptic, random thoughts at 2 AM lead me to suspect Thread::Sociable could be extended to implement that as well.
  • Definitely need some benchmarks running this on top of Hoard on an SMP box.

Stack tuning solved part of the footprint issue. Thread::Sociable hopefully trims much of the fat from shared variables. Wish I had the lore to do iCOW...

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.