[Ironruby-core] Thread priority
Pascal Normandin
pascal.normandin at convergentware.com
Fri May 15 00:04:52 EDT 2009
Hello,
I’ve looked into this and it is pretty easy to implement. But I have a question before I send any modification.
The Clr Thread works with 5 levels (Lowest, BelowNormal, Normal, AboveNormal and Highest) but based on the ruby doc a ruby thread works with an integer for priority. So I’ve decided to go with the following mapping
Lowest <= -2
BelowNormal == -1
Normal == 0
AboveNormal ==1
Highestvalues >= 2
Is that correct ?
Excuse me if that’s too basic but I’m pretty new to Ruby and even newer to IronRuby.
Thanks;
Pascal
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Tomas Matousek
Sent: May-12-09 12:56 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Thread priority
Thread#priority attribute is not implemented yet, that’s why the CLR property is picked up.
It should be easy to implement it. Any volunteer?
Tomas
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero
Sent: Tuesday, May 12, 2009 5:41 AM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Thread priority
You can just use the enum from ironruby
System::Threading::ThreadPriority.normal
---
Met vriendelijke groeten - Best regards - Salutations
Ivan Porto Carrero
Blog: http://flanders.co.nz
Twitter: http://twitter.com/casualjim
Author of IronRuby in Action (http://manning.com/carrero)
Emma Goldman <http://www.brainyquote.com/quotes/authors/e/emma_goldman.html> - "If voting changed anything, they'd make it illegal."
On Tue, May 12, 2009 at 1:59 PM, Shay Friedman <lists at ruby-forum.com> wrote:
Hi there,
Ruby allows to set the thread priority using the priority= method:
Thread.new do
Thread.current.priority = -1
... blah blah blah ...
end
This is not available in IronRuby because priority maps to the
System.Threading.Thread priority property which looks for the
ThreadPriority enum. Is it going to change or is this the right behavior
for IronRuby?
Thanks,
Shay.
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ironruby-core mailing list
Ironruby-core at rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20090515/e135a6a6/attachment.html>
More information about the Ironruby-core
mailing list