On 28/08/09 at 09:19 +0200, Petr Salinger wrote:
> On the other hand, I see some problems with handling of fork()/exec().
> There really should be reinitialization of locks in child,
> the timer should be started using pthread_once(), the current
> approach is fragile and might lead to start of more timer threads.
> IMHO, the code needs audit in this area.
> 
> I.e., I really doubt the following code in process.c
> for rb_f_fork(VALUE obj) is correct:
> 
>     switch (pid = rb_fork(0, 0, 0, Qnil)) {
>       case 0:
> #ifdef linux
>         after_exec();
> #endif
>         rb_thread_atfork();
>         if (rb_block_given_p()) {
>             int status;
> 
>             rb_protect(rb_yield, Qundef, &status);
>             ruby_stop(status);
>         }
> 
> The conditional after_exec() shouldn't be here.
> There is already "after_fork()" at line 2331,
> which is executed for both parent and child.
> The exception is when chfunc is not NULL,
> then it is not executed at all.

Hi Petr,

Do this problem only affect the Linuxthread-based pthread
implementations, or also NPTL? I think that ruby is written with the
asumption that pthread == NPTL, unfortunately...

Are there plans to switch to something that has the exact NPTL semantics
on FreeBSD ?
-- 
| Lucas Nussbaum
| [email protected]   http://www.lucas-nussbaum.net/ |
| jabber: [email protected]             GPG: 1024D/023B3F4F |



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to