Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT cygwin DOT com Delivered-To: mailing list cygwin-developers AT cygwin DOT com From: "Robert Collins" To: "'Conrad Scott'" , , Subject: RE: System-wide mutexes and pthreads Date: Thu, 13 Jun 2002 06:19:42 +1000 Message-ID: <005401c2124e$7cb91a90$0200a8c0@lifelesswks> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal In-Reply-To: <01b801c2123e$d7efe250$6132bc3e@BABEL> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 > -----Original Message----- > From: cygwin-developers-owner AT cygwin DOT com > [mailto:cygwin-developers-owner AT cygwin DOT com] On Behalf Of Conrad Scott > Sent: Thursday, 13 June 2002 4:28 AM > To: cygwin-developers AT cygwin DOT com; cygwin-developers AT cygwin DOT com > Subject: System-wide mutexes and pthreads > > > Looking at the current pthread implementation on cygwin, it > seems that it > doesn't support any system-wide synchronization mechanisms > (i.e. none of the > synchronization primitives allow PTHREAD_PROCESS_SHARED and > there are no > named semaphores). Before I go and use win32 semaphores in > the cygserver, is > there something I'm missing? You're missing nothing, but I can help a little here: Cygserver coding guidelines: 1) Trust nothing. Don't trust Process ID's, access rights or anything else. Always check via an alternate path if you are able to. 2) Use pure win32 code wherever possible. I used pthread_once because I could :}, but other than that you'll find it's all native objects. The only other big exception being using domain sockets, and that's because they are so dang useful for LPC. 3) The cygserver needs to be robust. It should never need to wait on a user owned mutex or event, and if it absolutely has to wait on such a thing should always use a timed wait call. 4) Latency. Try to get the most bang for each cygserver LPC call. It's better to spend a few cycles setting up several parameters than to wear the overhead of (say) access checks multiple times. Hope that helps, Rob