Am Donnerstag, 17. Mai 2007 18:58:35 schrieb Jan-Simon Möller:
> 2nd Version ...
>
> see file ...
>
Some comments to my last post:

As far as i could figure it out, my "timing"-problem is related to Threading 
and the signals (waitone(), set() ).
In my "special" case a second thread (waiting in writeComplete.waitOne()) took 
the Signal (writeComplete.Set() ) of the first thread (waiting for the 
IAsyncResult/Callback).

With the new array

+                       AutoResetEvent[] eventArray = new AutoResetEvent[2];
+                       eventArray[0] = allComplete;
+                       eventArray[1] = writeComplete;
+                       WaitHandle.WaitAll(eventArray);
+                       writeComplete.Set();

The 2nd thread can only consume the writeComplete.Set() if allComplete.Set() 
is also signalled. This helps to ensure that no Thread takes the wron signal.

The Problem arose here with a "fast" network connection (loop). My solution 
helps to separate 2 Threads. not 3. But i don't think 3 is realistic (for the 
same file/download-loop).

The other Read()-functions should be altered like this as well.

Greets
Jan-Simon
_______________________________________________
ifolder-dev mailing list
[email protected]
http://forge.novell.com/mailman/listinfo/ifolder-dev

Reply via email to