On 09.10.2010 23:20, Robert Jacques wrote: > On Sat, 09 Oct 2010 14:48:29 -0400, Sean Kelly > <[email protected]> wrote: >> What are the limitations of this for multithreaded use and >> reentrancy? Can I modify the handler list from within a handler, etc? > > Delegates as currently not safe for multithreaded use as delegate > modifiers (pure, shared, immutable, etc) don't work yet, IIRC. The > library appears to be designed for signal thread use only. Currently, > modifying the handler list from within a handler would result in > undefined behavior. Like the old implementation this implementation doesn't support multithreaded use (yet). I thought about it a little and I think making it thread safe using mutexes shouldn't be hard. I know message passing is supposed to be used whenever possible, but I don't think it works well in this case.
With the new implementation SList is used internally. SLists stableInsertAfter and stableLinearRemove do not invalidate ranges, so at least for single thread use modifying the handler list from within a handler should be fine. The emit call's reentrancy depends on SLists opSlice reentrancy, but I guess it is reentrant. If delegate modifiers really don't work yet, this could be a problem. -- Johannes Pfau _______________________________________________ phobos mailing list [email protected] http://lists.puremagic.com/mailman/listinfo/phobos
