Thread overview
Sigal & Slot Implementation In D
Sep 17, 2008
Sam Hu
Sep 17, 2008
Frank Benoit
Re: Signal & Slot Implementation In D
Sep 18, 2008
Sam Hu
Sep 18, 2008
Frank Benoit
September 17, 2008
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.
September 17, 2008
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.


September 18, 2008
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
September 18, 2008
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.