Re: sem_open() returns ENOSPC
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.10) Gecko/20100512 Lightning/1.0b1 Thunderbird/3.0.5 Norm Green On 14 Jul 2010, at 23:42, Norm Green wrote: You won't need to call sem_close(), but if you're generating the names for your semaphores algorithmically and you might generate many different names, you *will* need to call sem_unlink(). Semaphores are shared between processes, and once created they continue to exist (with the same name) until they're explicitly deleted with sem_unlink(). Kind regards, Alastair. -- http://alastairs-place.net _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... Well that might account for the problem. Since I need (but do not have) unnamed POSIX semaphores in Darwin, I generate a random name for each semaphore but unlink. Sounds like I need to find some way to allocate semaphores with a well known name and then unlink it before attempting to use the name again. On 7/14/2010 3:51 PM, Alastair Houghton wrote: As I said in my post, the process is in start-up when I get the error, so I'm confident I don't have a leak at this point. Do I need to call sem_close() even if the process terminates? This email sent to site_archiver@lists.apple.com
participants (1)
-
Norm Green