Using the Compact Framework Monitor class on Windows CE-based devices

Summary

The Monitor class appears to behave differently on Windows CE-based systems than it behaves on desktop systems. This allso affects the implementation of the C# lock statement and the Visual Basic SyncLock code block since their implementation is based upon static methods of the Monitor class.

More Information

The underlying implementation of Monitor differs considerably between the .NET Compact Framework and the .NET Framework. The .NET Compact Framework is designed for use on real-time systems, like Windows CE and its derivatives, while the .NET Framework is designed for use on desktop or server systems which are not real-time.

There may be subtle timing differences observed. In the event that identical behavior is required of code expected to run under both the .NET Compact Framework and the .NET Framework, it can be achieved by using a Mutex instead of Monitor (or lock or SyncLock.)
內容

文章識別碼:2718559 - 最後檢閱時間:2012年6月4日 - 修訂: 1

意見反應