I would suspect that the order is undefined for asynchronous operations.
Being async, the calls are likely marshalled to a separate thread for
execution. if multiple calls are made, then you have multiple threads, all
running at the same priority. In *most* cases they would get processed in
the order they were given to the scheduler, however there's nothing that
says that if the scheduler processes a higher priority thread (like a
driver) that when it comes back to the apps priority that it has to do them
in any order. It just round-robins all waiting threads at that priority.
You shouldn't make any assumption about the order that they will run - if
the order is important, you should enforce it through synchronization
objects.

Signature
Chris Tacke, eMVP
Join the Embedded Developer Community
http://community.opennetcf.com
> Does anyone know if the order of delegate calls onto a thread through
> BeginInvoke are guaranteed to come in the same order that they are
[quoted text clipped - 13 lines]
>
> Thanks!
stealthrabbi - 30 Nov 2007 13:05 GMT
Doesn't the windows message pump work like a queue, which would
suggest that it would process them in order?
http://www.codeproject.com/csharp/begininvoke.asp
> I would suspect that the order is undefined for asynchronous operations.
> Being async, the calls are likely marshalled to a separate thread for
[quoted text clipped - 30 lines]
>
> > Thanks!
<ctacke/> - 30 Nov 2007 14:33 GMT
Yes, but you're assuming that they *get* to the queue in the same order that
you call Invoke for the reasons I've outlined. I don't think you can
guarantee that - I sure wouldn't rely on it. Again, you should never make
any assumption about the order of asynchronous processing. If you need
there to be some rigid order, you should enforce it, not just hope that
things will somehow work out.

Signature
Chris Tacke, eMVP
Join the Embedded Developer Community
http://community.opennetcf.com
> Doesn't the windows message pump work like a queue, which would
> suggest that it would process them in order?
[quoted text clipped - 38 lines]
>>
>> > Thanks!