[Glorp-development] Thread safe ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Glorp-development] Thread safe ?

Mark Plas
Hi,

This mail is part of a set of glorp questions I have (see some other
mails I've sent recently).

The topic I would like to address here is:

Is glorp 'thread safe' in some sense ? If I want to fork several
processes and each of them uses its own glorp session (possibly using
the same database connection), will I get into trouble provided my
domain code is thread safe ?

Thanks,
Mark

Reply | Threaded
Open this post in threaded view
|

Re: [Glorp-development] Thread safe ?

Alan Knight-2
This one didn't seem to appear in the glorp-development list, so I'll answer it here directly.

Glorp sessions are completely independent, so between different sessions operation is completely thread-safe. There are no shared objects between them.

Within a single session, there is mutual exclusion on query execution. This should provide thread safety, but is fairly coarse-grained. I haven't encountered, or seen reports of thread-safety issues, but I also haven't done anything to try and seriously stress thread-safety aspects.

At 03:46 AM 12/11/2006, Mark Plas wrote:
Hi,

This mail is part of a set of glorp questions I have (see some other
mails I've sent recently).

The topic I would like to address here is:

Is glorp 'thread safe' in some sense ? If I want to fork several
processes and each of them uses its own glorp session (possibly using
the same database connection), will I get into trouble provided my
domain code is thread safe ?

Thanks,
Mark

--
Alan Knight [|], Cincom Smalltalk Development

"The Static Typing Philosophy: Make it fast. Make it right. Make it run." - Niall Ross