Subject | Re: [Firebird-Java] Is EventManager of the Event API (JayBird 2.1b) thread safe? |
---|---|
Author | Gabriel Reid |
Post date | 2006-06-27T20:10:48Z |
> I'm wondering if the EventManager is thread safe.For your purposes, the EventManager can be considered thread-safe.
>
> I looked at the code and there are some traces of synchronisation. However, I would like a
> confirmation from you (of course, if you have an idea:o).
>
> I would like to know if I can have multiple threads adding EventListeners and simultaneously
> threads blocked waitForEvent?
The synchronization that is used within EventManager was used to handle
a listener un-registering itself during its own callback (which occurs
in a separate thread: the event loop thread). Though the EventManager
class wasn't specifically implemented with the kind of multi-threaded
use that you're talking about, it should be able to handle it without
any problems.
The class itself is definitely not fully thread-safe; the connect
and disconnect logic should only be run from within a single thread.
Regards,
Gabriel