On Wed, Mar 2, 2011 at 6:49 PM, Daniel Solano Gomez wrote:
> On Wed Mar 2 15:44 2011, clj123123 wrote:
> > In a multi thread app, is there a way to mark a function to be
> > blocking so it can run not simultaneously but would be blocking for
> > each thread?
>
> You could try the locking macro.
Yes, `locking` on the function itself will work; it's roughly equivalent to
a `synchronized` method in Java.
Also try Agents, as Ken suggests.
-Stuart Sierra
clojure.com
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send em
On Wed, Mar 2, 2011 at 6:49 PM, Daniel Solano Gomez wrote:
> On Wed Mar 2 15:44 2011, clj123123 wrote:
>> In a multi thread app, is there a way to mark a function to be
>> blocking so it can run not simultaneously but would be blocking for
>> each thread?
>
> You could try the locking macro. For
On Wed Mar 2 15:44 2011, clj123123 wrote:
> In a multi thread app, is there a way to mark a function to be
> blocking so it can run not simultaneously but would be blocking for
> each thread?
You could try the locking macro. For this you need an object to lock
on. I suppose you could lock on th
In a multi thread app, is there a way to mark a function to be
blocking so it can run not simultaneously but would be blocking for
each thread?
Thanks.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googl