From: <po...@or...> - 2004-05-07 12:20:13
|
"Matias Guijarro" <gui...@es...> writes: > Hello, > > I would like to know if it is thread-safe to > use PyDispatcher when signals are emitted > from a thread, with receivers from other > threads and vice versa. > > Reading source code, I did not notice any > special code for dealing with this kind of > usage. I expected to see some Queues, > or Locks, etc. > > However I tried to use it with threads, and > for my particular example it worked... As > it is said to be a 'multi-producer, multi- > consumer signals dispatcher', I think it is > thread-safe ? > > If so, how it is achieved ? > I would like to understand :-) > > Thanks in advance for your answer! The original was not designed to be thread-safe. I'm not sure if Mike changed anything in the current version to make it so, but I doubt it. I don't know too much about threading with Python, so I'm not sure how hard it would be to make the dispatching thread-safe. If it could be done rather simply and elegantly I'm sure we'd love to have a patch that adds this feature. -- Patrick K. O'Brien Orbtech http://www.orbtech.com Blog http://www.sum-ergo-cogito.com |