for a project I'm working on, I need to work with threads. I was wondering: what is the state of parallelism in MS C#
and, particularly, Mono
, as compared for example to OpenMP
and pthreads
? How much control do I have over threads in C#? What will I not be able to do? For instance, can I synchronize explicitly? Can I work directly with mutexes? Can I do conditional wait? Thanks.
You'll have virtually all the control over threads
The .NET framework contains virtually all ( monitor
, manualresetevent
, autoresetevent
, sempaphore
, readerwriterlock
etc) primitives. For special needs catering you can always P/Invoke (though you'll have to have multiple implementations to stay portable)
Mono has a PLINQ implementation (coming along)
See Miguel de Icaza's blog post on C# 3.0 and Parallel FX/LINQ in Mono . It
should be
is in Mono 2.8
So yes yes yes and yes :)
在Mono上,您可以像在.Net上一样对待线程程序,托管代码的运行时兼容性是Mono项目的主要目标。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.