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 08:04 AM, Michael George wrote:
Looking at the Kernel Programming docs on the ADC site, I've found a page on Creating and Destroying Threads. There it is documented how one can create a thread with the IOThread call: IOCreateThread(), and then kill it with the mach thread calls: thread_terminate(getact_thread( thread_t/IOThread ) ).

Obviously, we need to fix that document on the "killing" side of things. You really shouldn't asynchronously kill threads - especially kernel threads. You should arrange to have the thread kill itself. The easiest way to do this is to have it return from its initial function. If this isn't convenient for you, you can have the thread call IOExitThread() explicitly (after assuring that all the resources it allocated, and is still responsible for, have been freed).

--Jim
_______________________________________________
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.

References: 
 >kernel threads (From: Michael George <email@hidden>)



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.