Android provides a Handler
class that runs tasks (of type Runnable
or Message
) serially on a single thread. I am trying to reproduce this exact behavior in a Windows Store App and the only classes I see are ThreadPool
and ThreadPoolTimer
which I believe provides access to a pool of background threads, but what I want is access to a single background thread.
If it isn't possible with the WinRT API what about with the allowed Win32 API's?
The reason for all this trouble is that I have an old C++ library that is only safe to run on a single thread but I don't want to run it on the UI thread since it could block it. Often times I'd like to queue up a bunch of tasks to have the library execute. Handler
in Android was perfect for this.