libc_r/uthread/uthread_join.c

Daniel Eischen eischen at vigrid.com
Wed Dec 31 05:47:05 PST 2003


On Wed, 31 Dec 2003, Marc Olzheim wrote:

> Hi.
> 
> Is there a reason why in the case that a thread is not done yet,
> pthread_join() does not call _thread_kern_sig_undefer() ?
> 
> We have a program where one thread consumes all CPU it can get for
> blocks of data.
> A status thread is spawned as soon as the main thread starts working on
> a new block, printing an 'x % done' message and sleeping for a second in
> a loop. When the block is processed, the status thread is
> pthread_cancel()d and the main thread does a pthread_join() to wait for
> the status thread to exit. Now, when the second block is to be
> processed, a new status thread is spawned, but since signals are still
> defered and the main thread needs all the cpu it can get, it doesn't get
> scheduled in anymore.
> 
> The following fixed the problem in 4-STABLE and it seems to work ok, but
> I'm no sure if there was a reason for the omission of the call in that
> case...

No, it looks like you found a bug.  Committed, thanks!

-- 
Dan Eischen



More information about the freebsd-hackers mailing list