Question

Just looking for confirmation or documentation regarding how threads are used for the async patterns on sockets under Windows CE, specifically for a socket's BeginRead. I've looked on MSDN's documentation, but I can only find vague references. I've searched here for it and have found answers to the desktop threading model. As a side note, the program is implemented in Compact Framework.

My understanding is thus: On the desktop calling BeginXXX, the callback may or may not be invoked by a different thread than the thread calling BeginXXX. (Taken from the ThreadPool from what I've read and experimented with)

On Windows CE, when calling BeginXXX, the callback is handled by the thread that made the call to BeginXXX.

Is this accurate? If so, where can I find the documentation on it? STW didn't help, and neither did RTM.

Was it helpful?

Solution

I had to do the threading manually. The threading model is slightly different on Windows CE 6 than it is on desktop platforms. The asynchronous code worked fine when I developed it on the desktop but wouldn't work at all on CE. I ended up shimming in send and receive threads that sat on top of the sockets. I'm still not sure of the reason, I'm going to guess that the vendors that wrote the platform code for the hardware drivers made some decisions that weren't quite on par with what the compact framework is expecting. Anyway, it works now, and the threads that are blocking are mine, and can block without stopping the main thread.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top