Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: kernel threads



On Thursday, December 5, 2002, at 02:20 PM, David Gatwood wrote:
On Thu, 5 Dec 2002, Michael George wrote:
BTW, I would *strongly* recommend something to the effect of "you
cannot really terminate kernel threads besides yourself -- even if you
do, the thread is only marked aborted and not really terminated"
Something like that would have saved me a couple hours yesterday...

You mean like "In general, you can only be assured that you can kill
yourself, not other threads in the system"?

Yeah, that's *real* clear when you follow that up with "With that in mind, you may be able to terminate a thread as follows: thread_terminate(getact_thread(thread_t thread));
"... Huh, I have no clue why I thought it would be possible to terminate another thread...

Reading that statement you quote, I took that to mean:
"It is dangerous to asynchronously terminate other threads in the system for the reasons just stated. To try to terminate anything but yourself is very risky. However, if you know what you are doing, here's a way to do it..."

However, in my case I read the cautions and knew that the thread would be safe to kill at any point. Therefore, that's why I continued to try to kill it.

Had I known that even if I did succeed at finding a way to "terminate" the thread, it would not have really terminated but marked as "aborted" I would have stopped looking...

One of the annoying aspects of working with OS X is these cases where functionality disappears on subsequent releases. getact_thread() is one case, /dev/st0 is another. No mention in the headers that it was removed for any particular reason, just disappears.

Don't get me wrong, though, OS X is still my favorite commercial OS and I recommend it over a Windoze box anytime I can. But it still has its shortcomings...

-Michael
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.