The reason why I was weary about the thread_call stuff was cause I don't want to have to keep calling thread_call_allocate everytime the thread needs to be called, or do I just allocate it once, say as a global, and allocate it in my Start method and also I guess do the same with the thread_call_function and then in the actual send function that needs to call the thread, then use those global parameters and create the call to the thread, this just seems like so much more work. Matt On Jun 17, 2004, at 3:03 PM, Godfrey van der Linden wrote: G'day Matt, The problem with IOCreateThread/IOSleep is that you are tying up a lot of kernel resource to little effect. <kern/thread_call.h> and BSD's <sys/systm.h> both use a more efficient model which is to use a shared pool of threads. 'thread_call' has the advantage that it is efficient to rearm and re-schedule. But timeout in <sys/systm.h> is better known and fairly easy to use. Don't worry about either of these APIs going anytime soon. Godfrey On Jun 17, , at 13:26, Matt Jaffa wrote: hmmm I found a pretty good method for accomplishing my purposes, unless it isn't a good way. use IOCreateThread to create the thread and run it, then inside the thread function I call IOSleep(timetosleep); then so the work after the thread wakes up. If I read correctly these are just wrappers for the mach_threads, and I guess IOKit knows threads better to me, so I will let that API take care of it, as long as this API is going to be staying along time. I don't really care if the thread wakes up anywhere from 1 to 10000 milliseconds off from what I told it to sleep, so this method should work for me, unless there is a suggested and recommended way. Matt On Jun 17, 2004, at 12:30 PM, Godfrey van der Linden wrote: G'day Justin, You are right it is #include <kern/thread_call.h> // And can be found in xnu/osfmk/kern It sort of depends on what you want to do with the timeou()t. But for regularly scheduled timeouts I prefer using thread_call_enter directly as it is lighter weight and closer to my requirements. Godfrey On Jun 17, , at 10:38, Justin Walker wrote: On Jun 17, 2004, at 10:11, Godfrey van der Linden wrote: Check out <xnu/kern/thread_call.h> Huh? I don't find such a file. What about a 'timeout()' call? _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored. _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored. _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.