Hello,
For my extended POP3 library I'm running code inside my library in an asynchroneous way (runnable).
It downloads a message with the given index (supporting TOP) and calls an event "downloadcompleted" when the message retrieval is finished. The calling of this event is done by RaiseEventFromDifferentThread. The code was based on the Erels code.
I am wondering: what if I modified this code so that all messages will be downloaded in a single run (sort of a loop around previous code) and I would call this same event within each iteration of this loop ?
In this way it would be possible that RaiseEventFromDifferentThread would be called a second time when the first is still running in the foreground thread (especially when the code running in the foreground thread is relatively slow). Do I have a synchronization problem in this way ?
Thanks !
For my extended POP3 library I'm running code inside my library in an asynchroneous way (runnable).
It downloads a message with the given index (supporting TOP) and calls an event "downloadcompleted" when the message retrieval is finished. The calling of this event is done by RaiseEventFromDifferentThread. The code was based on the Erels code.
I am wondering: what if I modified this code so that all messages will be downloaded in a single run (sort of a loop around previous code) and I would call this same event within each iteration of this loop ?
In this way it would be possible that RaiseEventFromDifferentThread would be called a second time when the first is still running in the foreground thread (especially when the code running in the foreground thread is relatively slow). Do I have a synchronization problem in this way ?
Thanks !