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

Gary M. Smithrud gary.smithrud at haley.com
Sun Jul 31 13:04:02 EDT 2005


I think that this answers it:

Search of archives shows 2002/2003 mail-list items saying its a TODO,
and not high priority ....

And it's probably still not a high priority.  SpinWait is a more
efficient wait then the standard blocking mechanism (in most cases), but
since it is only a more efficient version of Wait it is not implemented
yet.  SpinWait goes into a loop to grab the lock before giving up and
entering the wait state...and no, it is actually more efficient because
if you can grab the lock before entering the wait state, the better the
performance.

Gary M. Smithrud
Haley Systems, Inc.
Phone: 724-934-7853
gary.smithrud at haley.com
www.haley.com
Moving at the Speed of Change

-----Original Message-----
From: mono-devel-list-bounces at lists.ximian.com
[mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf Of ted
leslie
Sent: Sunday, July 31, 2005 2:37 AM
To: mono-devel-list at lists.ximian.com
Subject: [Mono-devel-list] Thread SpinWait not supported? Interrupt ?


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? 

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().

Search of archives shows 2002/2003 mail-list items saying its a TODO,
and not high priority ....

I have read some workarounds, but I can't help but think if  Interrupt
is supposed to also interrupt a Sleep,
this would be handy.

Is there a big implementation delima? Or is it not considered a high
priority?

On to the suggested work around ................... 
--------------------------------------------------------------------
On Fri, 2003-02-28 at 11:53, Yury Serdyuk wrote:
> Hi !
> 
> We see in the "List of not-implemented classes" that
> the Interrupt - method didn't realized yet.
> In particular, the following program  doesn't work properly  :
> 
> But this function is very important for multithreading applications.
> So,  tell us about the current status of this problem,

Thread.Interrupt() has not been implemented, and it is way down on my
todo list.

> or is there a walk-around of it ?

Use events to signal state changes between threads?

- Dick
------------------------------------------------------------------------

-tl



_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list



More information about the Mono-devel-list mailing list