Multithreaded trigger question

138 views
Skip to first unread message

Simon

unread,
Jun 13, 2012, 12:02:46 PM6/13/12
to dotnet-state-ma...@googlegroups.com
Hi,

First off, great library! We are looking into using the library for a major project instead of WWF. We are doing some pilots with Stateless and I was wondering how Stateless handles multiples triggers at the same time. For instance when two triggers at the same time are fired, are they queued (with locks for instance)? Or will the be handled at the same time?
If so, it is possible that when one permitIf action takes longer than the other, the first will always succeed the other?
We are now using locks to prevents this kind of behaviour, and would like to know if Statless has anything like this build-in.

Thanks!

Simon

Nicholas Blumhardt

unread,
Jun 16, 2012, 11:16:18 AM6/16/12
to dotnet-state-ma...@googlegroups.com
HI Simon,

Thanks for checking Stateless out! The state machine is completely single-threaded, so you'll need to protect it with a lock yourself if you want to use it concurrently.

Cheers,
Nick

Simon Mingaars

unread,
Jun 18, 2012, 8:13:35 AM6/18/12
to dotnet-state-ma...@googlegroups.com
Hi Nick,

Thanks for the reply, I already thought it wasn't thread safe (check out the sources with reflection), but I just wanted to be sure. We'll be locking the Fire() method. That should do it right?

Thanks again!

Cheers,


Simon

Nicholas Blumhardt

unread,
Jun 18, 2012, 10:08:18 AM6/18/12
to dotnet-state-ma...@googlegroups.com
Hi Simon - that sounds about right, good luck with the project.

Nick
Reply all
Reply to author
Forward
0 new messages