Date: Wed, 06 Jun 2012 22:16:00 +0100 From: "Niall Douglas" <s_sourceforge@nedprod.com> To: freebsd-threads@freebsd.org Subject: Re: Inter Process Synchronisation Message-ID: <4FCFC890.598.57F02437@s_sourceforge.nedprod.com> In-Reply-To: <4FCEFE33.9010708@inforcept.com> References: <4FCDF845.9080704@inforcept.com>, <4FCE0AB6.32705.5122593A@s_sourceforge.nedprod.com>, <4FCEFE33.9010708@inforcept.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 6 Jun 2012 at 9:52, Resit Sahin wrote: > I thought i can ask inter-process related issues in this list. Which > list is appropriate for such issues? This list is for FreeBSD specific threading issues. For example, if FreeBSD's POSIX threads implementation has some weird behaviour not seen on other POSIX implementations. It isn't for general POSIX programming questions. Yours is a general programming question, not even POSIX related really. There are many good books on threaded programming. > I did not get why should i need to create a new copy of the stats each > time? If what I said didn't make sense you then it's probably not important to your use case. If you want it to make sense, look up cache coherency overheads and bus snoop protocols. I vaguely remember once seeing an okay Wikipedia page on the topic. > I wanted to post in this list because i want to learn if there are other > ways to synchronise between processes without using semaphores. As far > as i understand from your answer i can use atomic variables between > multiple processes. Do you mean this > <http://www.freebsd.org/cgi/man.cgi?query=atomic_add&apropos=0&sektion=0&manpath=FreeBSD+9.0-RELEASE&arch=default&format=html> > with atomic operations? C11 and C++11 have a perfectly good atomics library. Failing that, GCC, Clang and MSVC all have their own atomics libraries which do what C11 and C++11 do but with different function names. Failing that, all modern assemblers have atomic instructions. Niall -- Technology & Consulting Services - ned Productions Limited. http://www.nedproductions.biz/. VAT reg: IE 9708311Q. Work Portfolio: http://careers.stackoverflow.com/nialldouglas/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4FCFC890.598.57F02437>