Export to GitHub

qtd - issue #7

Signal issues


Posted on Feb 5, 2009 by Swift Rabbit

Hi eldar,

great that the signal/slots worked. Some comments:

1) why separate the storage of functions and delegates, they can be added to the same array

2) thread safety Is this supposed to be thread safe?

2.a) In that case adding some synchronized(this) when adding slots or executing is needed

2.b) You want to avoid executing a second call before the first is done? or simply skip some if too many calls come at the same time? If the first simply setting a a variable isExecuting is not enough. For the second it is ok, but not that some slots might have already finished executing when the second notification comes, if this is not wanted you have to change the thing to having at most one more notification call waiting, and doing return on the others, but this with a semaphore or atomic counter that counts the pending calls and blocks one until the other has executed. In any case you want to do {{{ isExecuting=true; scope(exit) isExecuting=false; }}} to avoid problems with exceptions

continue with the great work! :) ciao Fawzi

Comment #1

Posted on Mar 17, 2009 by Massive Horse

Thanks for your comments. I hope the new implementation fixes some or all of the above.

  1. They could be merged together but we already have to use two distinct slot lists for weakly and strongly referenced slots, so maintaining another list for function pointers is not a problem.
  2. Slot connection, disconnection and execution is now synchronized

scope(exit) was added, thanks.

Status: Fixed

Labels:
Type-Defect Priority-Medium