site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Domainkey-signature: a=rsa-sha1; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=YgYyCdwsCpjj+yACRzIsfM7LojzS8b4LFx/YT0x7zblAzK34hiXzUnTbRawqjuQB3sdcU8yQMIzV1Segs+o3aG/2LirYSK7hOBWsRabbJ9Wdvx6fyOxvFHmhtFDQwb0ykviGN1xROUoR9De+yoKREI09RbqU6vbv/zi1SgRornM Hi: I've done some work with character devices on traditional BSD and linux in the past. Given that, and my relative inexperience with C++ and IOKit, I chose to implement my tutorial "hello world" pseudo character device driver wholly within the BSD subsystem of XNU. And I've run into something and would appreciate some guidance. The UNIX process in question does an ioctl(my_dev) and, once in kernel space, sits on a semaphore_wait(). Because this process is ptrace-attached to a child process, and that child process gets a signal (as part of the design), I expect that the parent process will get a SIGCHLD, and in doing so, pop out of the semaphore_wait() with a KERN_ABORTED. It works. Unfortunately, not always. Especially when there is a lot of context switching between the parent and child (as opposed to the parent mostly sleeping), things dont work as I expect. While the SIGCHLD is delivered and the custom SIGCHLD handler *does* run (asynchronously), the parent process never aborts its semaphore_wait(). Is this an SMP issue? Or something to do with funnels? Or should I be abandoning Mach semaphores in deference to tsleep()/wakeup()? Or should I use thread_block(), etc? I'm somewhat lost, even after having read the relevant sections of the kernel programming guide (which is a very well-written document, by the way!), and combing through the archives of this list. Thanks for any help, Chandra _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com