Multithreading

30 views
Skip to first unread message

Warren Spits

unread,
Dec 13, 2012, 1:48:21 AM12/13/12
to pacer...@googlegroups.com
Hi,

I'm considering using pacer with orientdb on a multithreaded sinatra app. Does pacer support multithreading? Does it have any multithread tests? Are there any special considerations when using pacer with multiple threads?

Warren.

Darrick Wiebe

unread,
Dec 13, 2012, 8:49:40 AM12/13/12
to Pacer Group
Hi Warren,

Pacer should be well suited for a multi threaded app because in most places it doesn't share state or try to manipulate any globals.

The one place where I have concerns is in the transaction code, where blueprints implementations also seem to have variation regarding their support for threading. For instance I've noticed that at least one graph was using threadlocal variables to store transaction state but don't recall seeing that in any others, though I haven't taken a close look lately. I've tried to provide isolation at the Pacer level recently by adding PacerGraph#threadlocal_copy which returns a new PacerGraph instance wrapping a new Blueprints instance which points to the same underlying graph. I'm not completely convinced that the #threadlocal_copy method is necessary and I have not pushed Pacer too hard in any multithreaded write-heavy apps so far.

Multithreaded tests would be a good idea but I haven't given any thought to that...

Basically I think Pacer is well designed for multi threading but probably needs some work in that area. If you've got the interest, contributions in that area would certainly be appreciated.

Cheers,
Darrick
Reply all
Reply to author
Forward
0 new messages