From: SASADA Koichi <ko1@...>
Date: 2012-07-10T18:44:41+09:00
Subject: [ruby-core:46295] Re: [ruby-trunk - Feature #5543] rb_thread_blocking_region() API is poorly designed

(2012/07/08 5:06), larskanis1 (Lars Kanis) wrote:
> 
> OK, then use 'void *' like rb_thread_call_with_gvl().

We conclude this feature follows:

(1) Don't touch the declaration of rb_thread_blocking_region().
    And mark it as obsolete.

(the name "blocking_region" is internal name.  I think it was bad name
to expose.

  BLOCKING_REGION(
    // from here
    do something without gvl
    // to here
  )
)

Do not use this API for newer extensions.  And replace it with the
call_without_gvl if you can.


(2) Change the return type rb_thread_call_without_gvl()

void *
rb_thread_call_without_gvl(
    void *(*func)(void *), void *data1,
    rb_unblock_function_t *ubf, void *data2)

rb_thread_call_without_gvl() and rb_thread_call_with_gvl() is
experimental (not exposed officially) function.  So we can expect that
only a few "compiling error" with it.

-- 
// SASADA Koichi at atdot dot net