Re: A blocking function

2011-03-02 Thread Aaron Cohen
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.

Re: A blocking function

2011-03-02 Thread Stuart Sierra
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

Re: A blocking function

2011-03-02 Thread Ken Wesson
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

Re: A blocking function

2011-03-02 Thread Daniel Solano Gomez
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

A blocking function

2011-03-02 Thread clj123123
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