Hi all,

Is there a way to ensure that only one dedicated thread is used for an
agent?

The same question was asked some time ago but I don't think it was
resolved.

My specific problem is that SWT throws an exception if I use different
threads to call it even though I am using an agent to avoid race
conditions.

I can of course avoid the problem by only callling SWT from the main
thread. However there will be situations where you want to use 2 or
more components with the same constraint.

The other solution of course is to start an old style java thread to
handle SWT and coordinate via Ref's. The problem is that it means
mixing two ways to handle concurrency in the same application (the
agent way and the old-style-thread way) which adds accidental
complexity to the application.

An ideal solution might be to be able to create a thread pool for an
agent. You can then specify the max size of the pool. Specifying the
thread pool size to be 1 will fix the problem.

Any ideas?

Thanks
Morten

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to