Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-Id: <4.3.1.0.20010626073933.00b93f80@pilot.msu.edu> X-Sender: genisiob AT pilot DOT msu DOT edu X-Mailer: QUALCOMM Windows Eudora Version 4.3.1 Date: Tue, 26 Jun 2001 07:44:19 -0700 To: "Robert Collins" From: Brian Genisio Subject: Re: mmap not share Cc: cygwin AT sources DOT redhat DOT com In-Reply-To: <033501c0fdd1$87ab0c20$0200a8c0@lifelesswks> References: <200106251947 DOT f5PJl3j26688 AT pilot24 DOT cl DOT msu DOT edu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed > > > Dirk, > > This mmap thing is annoying... not only because mmap does not sync >correctly, > > but because the cygipc shared memory interface uses mmap to do it's > > dirtywork... so mmaped files AND shm do not work correctly!!!! > > > > This racked my brain for a long while, until I created a workaround... >If I > > wanted to re-read the mmapped file, I had to unmap, and re-map... I >created a > > function I called mmap_sync (instead of calling msync, which does not >work > > either) and I put the unmap and map again in it... It created a lot of >needless > > overhead, but it was all I could think of to work around it... > > > > I hope I was of some help, and please tell me if you figure it out. > > Brian > > > >Brian, have you considered fixing this in cygwin1.dll, not in cygipc? >That way your workaround would allow everyone access. (I suspect your >workaround isn't the appropriate fix, but nevertheless).. > >Rob My fix is a hack in the application. I conditionally compile the shm gets and attaches, and add in the mmap calls, and then add the fake sync (where I unmap and re-map). So, there is no workaround in CygIPC or cygwin1.dll. I have spent a little bit of time looking through the cygwin source, but realized this would take a lot of debugging... I solved my problem even better by putting the reader application as a separate thread, spawned by the writing thread... all is happy!!!! BTW, I would have used some other IPC method, other than shared memory or mmapped files, but the data the apps share is quite large, so serial communications, such as pipes or sockets would not work for me :) Brian -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/