From: David Flanagan Date: 2007-08-10T13:53:59+09:00 Subject: Re: priorities of newly-created threads Nobu, I didn't know that about threads in Linux. Looks like Java has had the same limitation for years, and I never knew it! Thanks for the explanation. Still, I think that you ought to pretend that threads have priorities, for the sake of API compatibility, even though they are meaningless. Thread.current.priority = 2 # Allowed, but does nothing on Linux Thread.current.priority # => 2: because we're pretending t = Thread.new { sleep }.priority # => 0: I think it should be 2 Even though it is meaningless, I think that last line of code should return 2. Or the second line of code should always return 0. David Nobuyoshi Nakada wrote: > Hi, > > At Thu, 9 Aug 2007 08:38:41 +0900, > David Flanagan wrote in [ruby-core:11876]: >> In Ruby 1.9, newly created threads start at priority 0. I suspect that >> this is a bug. > > The current VM uses native threads. On linux, the scheduling > policy is defaulted to SCHED_OTHER, and the priority is bound > on 0 in that case. Therefore, it's rather the restriction of > the platform. >