Hello!

> I've found an interesting multithreading issue which is related not only to 
> ICS component but many many other components I've seen so far. It is a race 
> condition between two thread where one is triggering an event handler and 
> the other is removing (setting to nil) the event handler.
> [..]

Quite normal. The proper way to disable a handler is not nil'ing it nor
grabbing and saving pointer to handler proc and then calling it (because
then the thread1 may do something that thread2 don't want do), but using
a global, protected by critical section variable. 

But the best solution is to not nil any handler in another thread, ie. use
a logic that doesn't require such actions.

-- 
Piotr Dalek
[EMAIL PROTECTED]

----------------------------------------------------------------------
PS. Fajny portal... >>> http://link.interia.pl/f196a

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to