[#10193] String.ord — David Flanagan <david@...>

Hi,

41 messages 2007/02/05
[#10197] Re: String.ord — Yukihiro Matsumoto <matz@...> 2007/02/06

Hi,

[#10198] Re: String.ord — David Flanagan <david@...> 2007/02/06

Yukihiro Matsumoto wrote:

[#10199] Re: String.ord — Daniel Berger <djberg96@...> 2007/02/06

David Flanagan wrote:

[#10200] Re: String.ord — David Flanagan <david@...> 2007/02/06

Daniel Berger wrote:

[#10208] Re: String.ord — "Nikolai Weibull" <now@...> 2007/02/06

On 2/6/07, David Flanagan <david@davidflanagan.com> wrote:

[#10213] Re: String.ord — David Flanagan <david@...> 2007/02/06

Nikolai Weibull wrote:

[#10215] Re: String.ord — "Nikolai Weibull" <now@...> 2007/02/06

On 2/6/07, David Flanagan <david@davidflanagan.com> wrote:

[#10216] Re: String.ord — David Flanagan <david@...> 2007/02/07

Nikolai Weibull wrote:

[#10288] Socket library should support abstract unix sockets — <noreply@...>

Bugs item #8597, was opened at 2007-02-13 16:10

12 messages 2007/02/13

[#10321] File.basename fails on Windows root paths — <noreply@...>

Bugs item #8676, was opened at 2007-02-15 10:09

11 messages 2007/02/15

[#10323] Trouble with xmlrpc — James Edward Gray II <james@...>

Some of the Ruby code used by TextMate makes use of xmlrpc/

31 messages 2007/02/15
[#10324] Re: Trouble with xmlrpc — "Berger, Daniel" <Daniel.Berger@...> 2007/02/15

> -----Original Message-----

[#10326] Re: Trouble with xmlrpc — James Edward Gray II <james@...> 2007/02/15

On Feb 15, 2007, at 1:29 PM, Berger, Daniel wrote:

[#10342] Re: Trouble with xmlrpc — James Edward Gray II <james@...> 2007/02/16

While I am complaining about xmlrpc, we have another issue. It's

[#10343] Re: Trouble with xmlrpc — Alex Young <alex@...> 2007/02/16

James Edward Gray II wrote:

[#10344] Re: Trouble with xmlrpc — James Edward Gray II <james@...> 2007/02/16

On Feb 16, 2007, at 12:08 PM, Alex Young wrote:

Re: Ruby/YARV thread question

From: SASADA Koichi <ko1@...>
Date: 2007-02-09 15:49:08 UTC
List: ruby-core #10252
Hi,

Michael Neumann wrote:
> In thread.c, three YARV thread models are described. Which models will be
> used in Ruby/YARV? If model 2 (native threads with Giant VM lock) is used,
> can I use blocking system calls without releasing the Giant VM lock before?
> Probably not. I'm trying to understand how the future Ruby will behave in
> this respect.

Yes.  You must release Giant VM Lock before doing blocking task.  If you
need do this in extension libraries, use rb_thread_blocking_region() API.


API:
rb_thread_blocking_region(
  blocking_func, /* function that that will block */
  data,          /* this will be passed above function */
  unblock_func   /* if another thread cause exception with Thread#raise,
                    this function is called to unblock or NULL */
)

usage:

/* this function block some mins
 */
VALUE
solve_difficult_numerical_problem(void *p) {
  /* this needs some mins */
  return result;
}

/* unblock function
 */
void
ubf_solve_difficult_numerical_problem(rb_thread_t *)
{
  /* set flag it specify interrupts */
}

/* rb_define_method(klass, solve_difficult_numerical_problem_method, 1);
 */
VALUE
solve_difficult_numerical_problem_method(VALUE arg)
{
  void *data = /* ... */;
  return rb_thread_blocking_region(
           solve_difficult_numerical_problem,
           data,
           ubf_solve_difficult_numerical_problem);
}

notice:
(1) If you run on Parallel computer like multi-core CPU, you can run
above solve_difficult_numerical_problem() in *parallel*.  Of course, you
must make this function thread safe.

(2) You can't call Ruby's method from
solve_difficult_numerical_problem().  I'll prepare API to support this.

(3) some system calls like pthread_mutex_lock() has no way to unblock.
this means that you can't interrupt these system calls and can't
interrupt with timeout().

(3') select() system call can be interrupted with pthread_kill().  But
on cygwin system, pthread_kill() doesn't work well.  oops.


Regards,
-- 
// SASADA Koichi at atdot dot net


In This Thread

Prev Next