Is there any way to synchronize several instances of one background task?
I'm working on a universal windows 8.1 store project. I have a background task that receives raw notifications and downloads and updates some data (hopefully meeting the CPU quota and running time limitations).
I want to avoid running background work simultaneously on Windows Phone when several pushes arrive at once. That is, background task should check if another instance of it is running and exit quietly.
The only way I could think of was through a semaphore file in local storage... But since all file IO on WP is asynchronous, I don't see how I could get it working without race conditions.
Any ideas?