Subject: Re: [boost] [interprocess] native Windows cond_var + mutex
From: Dan Brown (dbrown_at_[hidden])
Date: 2011-10-28 14:22:20


> -----Original Message-----
> From: boost-bounces_at_[hidden] [mailto:boost-
> bounces_at_[hidden]] On Behalf Of Ion Gaztañaga
> Sent: Friday, October 28, 2011 1:42 PM
> To: boost_at_[hidden]
> Subject: Re: [boost] [interprocess] native Windows cond_var + mutex
>
> El 27/10/2011 14:24, Dan Brown escribió:
> >
> > Hi,
> >
> > Attached is a patch to implement interprocess_condition and
> > interprocess_mutex natively on Windows. Following are some detailed
> > notes. I hope this isn't too awkward of a time for a submission like
> > this - I realize there's a lot of 1.48 activity going on. One more
> > note about the patch - IIRC, some patch utils won't create
> > directories. This patch is intended to be applied to
> > boost/interprocess and relies on a new directory
> > boost/interprocess/sync/win32.
>
> You can't put HANDLEs as members for classes shared in memory between
> processes as they are void pointers only useful for the process that creates
> them. Using native windows synchronization for process shared
> synchronization primitives with POSIX lifetime semantics is not easy, no
> project like APR or Cygwin has achieved this AFAIK.

Yes and no. You're correct in that I overlooked the use of handles for interprocess_condition. I believe, though, that solving this for the interprocess_condition event handles is the same as the solution I use for win32/interprocess_mutex. Named mutexes (and events) can be used cross-process. It's a fairly straightforward fix unless I'm missing something. I'll get you an updated patch shortly.

Thanks for the feedback.

Dan