www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.dwt - Sigal & Slot Implementation In D

reply Sam Hu <samhu.samhu gmail.com> writes:
I noticed and read the module Signal.d inside the package tango.core and was
wondering whether this mechanism has been implemented in dwt or somewhere else.
Sep 17 2008
parent reply Frank Benoit <keinfarbton googlemail.com> writes:
Sam Hu Wrote:

 I noticed and read the module Signal.d inside the package tango.core and was
wondering whether this mechanism has been implemented in dwt or somewhere else.
DWT does not use tango.core.Signal In DWT the SWT like typed and untyped listeners are used. For convinience template functions exist to make the use of "curried"-delegates in a typesafe way available. See dgRunnable, dgListener.
Sep 17 2008
parent reply Sam Hu <samhu.samhu gmail.com> writes:
Hi Frank,

Well noted DWT uses typed and untyped listener.Just wanna know more about the
performance.AFAIK,the performance of signal & slot is far slower than call back
functions,how about listeners?Is it slower than signal & slots or in the middle
of call back functions and S&S?

Thanks,
Sam 
Sep 17 2008
parent Frank Benoit <keinfarbton googlemail.com> writes:
Sam Hu Wrote:
 Well noted DWT uses typed and untyped listener.Just wanna know more about the
performance.AFAIK,the performance of signal & slot is far slower than call back
functions,how about listeners?Is it slower than signal & slots or in the middle
of call back functions and S&S?
The concept of s&s is mainly, that they disconnect automatically and does not prevent an object from GC collection. It is not about performance IMO. The Listeners in DWT do use a virtual function call. So the call performance is not much of relevance, i think. But the creation of a Listener itself is always using a Heap allocated object. That might be of relevance.
Sep 18 2008