| www.delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
| Message-ID: | <3D455EA0.6050207@ra.anl.gov> |
| Date: | Mon, 29 Jul 2002 10:26:24 -0500 |
| From: | "Sukru Tikves" <stikves AT ra DOT anl DOT gov> |
| User-Agent: | Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1b) Gecko/20020721 |
| X-Accept-Language: | tr, en-us, en |
| MIME-Version: | 1.0 |
| To: | cygwin AT cygwin DOT com |
| Subject: | Interprocess friendly Semaphores |
Hello All,
I have a UNIX application that utilizes fork() and semaphores.
Unfortunately the current Cygwin behaiour is to terminate the child
process immediately, because it does not understand PROCESS_SHARED
semaphores.
[ thread.cc ]
> pthread_cond::fixup_after_fork ()
> {
> debug_printf ("cond %x in fixup_after_fork", this);
> if (shared != PTHREAD_PROCESS_PRIVATE)
> api_fatal ("doesn't understand PROCESS_SHARED condition
> variables");
I know that windows supports sharing semaphores between processes. The
following MSDN node describes it:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/synchro_1a2g.asp
Changing the above code piece and the following will probably fix
something. But I do not know the fork() behaviour and I'm sure that more
work will be necessary.
Also I do not know how to recompile Cygwin [ ./configure script says:
configure: error: can not find install-sh or install.sh in . ./.. ./../.. ]
Can you help me?
[ thread.cc ]
> /*attr checked in the C call */
> if (attr && attr->pshared == PTHREAD_PROCESS_SHARED)
> {
> // fail
> magic = 0;
> return;
> }
> if (wincap.has_try_enter_critical_section ())
> InitializeCriticalSection (&criticalsection);
> else
> {
> this->win32_obj_id = ::CreateMutex (&sec_none_nih, false, NULL);
> if (!win32_obj_id)
> magic = 0;
> }
> if (!win32_obj_id)
> magic = 0;
> }
PS: I have checked out sources via CVS.
--
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/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |