[Mono-devel-list] Thread SpinWait not supported? Interrupt ?

Ben Maurer bmaurer at ximian.com
Sun Jul 31 13:19:02 EDT 2005


On Sun, 2005-07-31 at 02:36 -0400, ted leslie wrote:
> Unhandled Exception: System.NotImplementedException: The requested feature is not implemented.
> in <0x0001d> System.Threading.Thread:SpinWait (Int32 iterations)
> in <0x00072> ServerClass:StaticMethod ()
> in (wrapper delegate-invoke) System.MulticastDelegate:invoke_void ()
> 
> 
> I tried a Thread.SpinWait / Interrupt demo program ...
> and mono doesn't support SpinWait ? Its an inefficent function, but if someone were to use it
> in MS .Net and expect there code to work on Mono? 

This patch should fix the issue. It doesn't really implement the thing
correctly (it should really have the pause instruction to help
hyperthreaded processors), but it's better than throwing.

> Then having said that,  SpinWait and Interrupt seem to be a matching pair,
> so without SpinWait, what is Interrupt going to be used for? It doesn't seem to Interrupt Sleep().

They have absolutely nothing to do with each other. SpinWait is designed
for spin locking (not really something you would ever do in managed code
-- the standard Monitors can take care of doing spin locks as are best
for the user's machine).

-- Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x
Type: text/x-patch
Size: 562 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050731/d4ecc6ec/attachment.bin 


More information about the Mono-devel-list mailing list