Re: pthread issues
Re: pthread issues
- Subject: Re: pthread issues
- From: Jason Evans <email@hidden>
- Date: Fri, 1 Mar 2002 15:22:36 -0800
On Friday, March 1, 2002, at 01:11 , Mark Asbach wrote:
please excuse if I send this question to the wrong list - I'm absolutely
new to the Darwin project.
This particular question crosses the kernel/userland boundary, so this
list should be fine. darwin-userlevel might have been slightly better
though.
Currently I'm trying to port a realtime CORBA ORB to Mac OS X. While it
compiles and runs fine on Solaris machines, I've got certain troubles
with X's pthread implementation. As I was told on the student developer's
list, the Darwin kernel currently doesn't support per-thread signals. So
I'd tried to replace the unimplemented calls to pthread_kill() with
pthread_cancel() or pthread_detach(). Both result in 'zombie' threads
that are stuck in a "semaphore_wait_trap" within pthread_exit() as the
gdb call chain tells me.
pthread_kill() doesn't merely kill the target thread; it sends a signal.
Signals in some cases are used for legacy or portability reasons to
communicate among threads, so unless you understand the application you
are porting well enough to be sure what it is using pthread_kill() for
(and you understand the program flow to know that pthread_cancel() won't
change things in a damaging way), pthread_cancel() probably won't do the
job for you. pthread_detach() surely won't help by itself, since all it
does is make a thread's exit state immediately reapable by the threads
implementation, (as opposed to keeping it around until pthread_join() is
called for the thread).
Since someone also stated, that this is a known issue and already
corrected in "the current builds of 10.2 (expected July or so)", I wonder,
if I can replace this specific part of Mac OS X's kernel with a current
build of Darwin (that hopefully got rid of this issue already) - and how
to do that in detail.
You could potentially get a Darwin system working with an updated xnu and
Libsystem, but this isn't for the faint of heart. Unless you're already
familiar with how Apple projects are built, you're in for several days of
learning. As for replacing those components on an OS X 10.1 box, I wouldn'
t even try it, since it is bound to break many other things.
Jason
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.