Date: Sat, 12 Aug 2000 00:50:26 +0200 From: Jonas Bulow <jonas.bulow@servicefactory.se> To: hackers@FreeBSD.ORG Subject: Re: IPC, shared memory, syncronization Message-ID: <39948331.5E83DE1B@servicefactory.se> References: <39943C37.76D2DBCC@servicefactory.se>
next in thread | previous in thread | raw e-mail | index | archive | help
Jonas Bulow wrote: > > What is the "BSD-way" of access to shared memory (mmap:ed) secure (avoid > race conditions, etc)? Right now I'm using posix semaphores but I would > like to know if there is a substitute like the way kqueue is for > select/poll. Hmm, I think I lost some word and deeper thought in my previous mail. :-) The problem is as follows: I have a couple of processes using a mmap:ed file as common data area. What I want to do is to make it safe for all processes to update data in this common memory area. I was thinking about using some part of the common data area for semaphores in some way. I just want a simple "test-and-set" operation I can use to make sure there is only one process writing to the common data area. To take the "test-and-set" further, I would like to make the process wait for the lock to be released. Can anyone give me hint how this is best implemented with FreeBSD as OS? I apology if this is not a pure FreeBSD related question but I could not find a better forum for this question. I could only find out solutions based on posix semaphores. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?39948331.5E83DE1B>