[#18121] [Ruby 1.8.7 - Bug #405] (Open) ssl.rb:31: [BUG] Bus Error — Anonymous <redmine@...>

Issue #405 has been reported by Anonymous.

14 messages 2008/08/04

[#18130] Re: New array methods cycle, choice, shuffle (plus bug in cycle) — Brian Candler <B.Candler@...>

> Seriously though... Array.first is a noun.

10 messages 2008/08/05

[#18319] NEW Command: absolute_path() -- — "C.E. Thornton" <admin@...>

Core,

14 messages 2008/08/16
[#18321] Re: NEW Command: absolute_path() -- — Yukihiro Matsumoto <matz@...> 2008/08/18

Hi,

[#18381] [Bug #496] DRb.start_service(nil) is very slow — Hongli Lai <redmine@...>

Bug #496: DRb.start_service(nil) is very slow

11 messages 2008/08/25

[ruby-core:18256] Re: Thread#priority(=) will be obsolete

From: "Bill Kelly" <billk@...>
Date: 2008-08-13 03:55:50 UTC
List: ruby-core #18256
From: "SASADA Koichi" <ko1@atdot.net>
> 
> Seeing other environment:
> 
> - Python: there is no priority on Thread.
> - Perl ithread: OS dependent priority.
>   (not affect on most UNIX environment)
>   (on Windows environment, we can use priority)
> - C, C++'s native thread: ditto.
> 
> (Please point out if you find mistakes)
> 
> 
> There are 2 options:
> 
> 1. This is Ruby's good point, so we must support
>    OS independent exact thread scheduler
>    (with development/running cost).
> 
> 2. We don't need such big mechanism on thread because
>    other environments don't support it.
> 
> (optional-3: we should choose 1 or 2 on build/launch timing)


Interesting.  This is what we've been doing on Unix systems
having pthreads.  However, I've not actually empirically 
verified it had any effect:

void set_thread_priority_low ()
{
    struct sched_param sp;
    int policy;

    memset(&sp, 0, sizeof(struct sched_param));
    pthread_getschedparam(pthread_self(), &policy, &sp);
    sp.sched_priority = sched_get_priority_min(policy);
    (void) pthread_setschedparam(pthread_self(), policy, &sp);
}

So when you say, "not affect on most UNIX environment" it makes
me wonder: does the above really work, or not?  :)


For completeness' sake, here's what we're doing on Windows:

void set_thread_priority_low ()
{
    SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_BELOW_NORMAL);
}



Personally I think it would be nice if ruby retained the
ability to say "make this thread low priority", even if
the non-portable integer priority values are removed.

(However, if that pthread code really has no effect on
most Unix systems, then . . . . I dunno :)


Regards,

Bill



In This Thread