且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Windows Phone 8.1中创建线程

更新时间:2022-04-27 23:17:54

如果您只想异步运行某些代码,请考虑使用

If you just want to run some code asynchronously, look into using Task.Run. It provides a much simpler mechanism than managing threads yourself.

如果要构建通用Windows Phone 8.1应用程序,则不能使用.NET Thread类型.如果需要对执行进行更多控制,则可以使用WinRT ThreadPool .

If you are building an Universal Windows Phone 8.1 app, you can't use the .NET Thread type. If you need more control over the execution, you can use the WinRT ThreadPool.

最后,如果您真的真的需要很多控制,则总是

Finally, if you really really need lots of control, there's always CreateThread if you want to write native code (this has recently been added to the allowed list of APIs for Store Apps, although MSDN isn't updated yet).