locked
Metro missing threading APIs - recommended replacements

    Question

  • I'm working to move a couple of libraries to Metro from a "normal" Windows environment and am trying to understand how to map APIs that are not in Metro to reasonable substitutes.

    This has not been too bad, but the threads APIs are a bit puzzling.  I understand the push to move to the thread pool model, but I can't really do that, at least not right now.

    I've found evidence online (must be true, right?) that _beginthreadex() is a legit replacement for CreateThread(), even though it apparently calls CreateThread() in its implementation.  But I'm still looking for solutions to ResumeThread(), SuspendThread(), and TerminateThread().

    So, any advice is appreciated.

    Bob

    Wednesday, February 29, 2012 8:22 PM

Answers

All replies

  • Have you seen Raman's response in this thread?

    You might find this useful in the future as well:

    Alternatives to Windows APIs in Metro style apps

    Thanks,

    -David

    Wednesday, February 29, 2012 9:10 PM
    Moderator
  • Hi David,

    Thanks for the quick response.  I've already looked in both of those places, and it was that same thread the Raman replied to that brought me to _beginthread().  As I said in my post, I can't rework this code at the moment to use the preferred thread pooling tools, so I'm looking for a way out for this one library.

    Very hard to believe that MS would leave these threading APIs out of Metro, but I'm guessing that they would like for Metro developers to move away from them.  But, I can't do that at this time, so I'm still looking for alternatives to the Resume/Suspend/Terminate thread APIs for this library.

    The link to Alternatives to Windows APIs in Metro style apps was really not much help I'm afraid.

    No other threading advice for Metro?

    Bob


    Bob Mance

    Wednesday, February 29, 2012 9:22 PM
  • Hi Bob,

    The options you discovered in the other thread and Windows.System.Threading documentation are the available threading options in Metro style apps. Wish I had a better solution to offer but in this case, your component will need some work to bring forward.

    Thanks,

    -David


    Thursday, March 1, 2012 2:23 AM
    Moderator
  • Hi David,

    Well, your response that "that component will need some work to bring forward", gives me hope.  Is there a plan, or a chance, that these missing threading APIs will be brought into Metro?

    Thanks again.

    Bob


    Bob Mance

    Thursday, March 1, 2012 2:50 PM
  • I apologize, I did not intend to instill false hope. I should have worded it, "your component using the Win32 Threading APIs, CreateThread, ResumeThread, etc. will need some work to bring forward".

    Thanks,

    -David


    Thursday, March 1, 2012 4:35 PM
    Moderator