Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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: <3E020B55.5000101@netcom.es> Date: Thu, 19 Dec 2002 18:09:25 +0000 From: Ignasi Villagrasa Organization: gri User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; es-ES; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 X-Accept-Language: es-es MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: try/catch and mutithreading Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi everyone, I've got a problem migrating several C++ based server applications from Watcom 10.5 compiler to cygwin. The problem arises when diferent threads get into a try/catch block concurrently. Then cygwin forces me to include a semaphore out of try block to solve a concurrency conflict that I didn't have using Watcom 10.5, or I don't have now only avoiding the try/catch structure. Source code void A() { MySemaphore.Request(); try { } catch(...) { } catch(...) { } MySemaphore.Release() ; return; } works properly in multithreading, but void A() { try { MySemaphore.Request(); } catch(...) { } catch(...) { } MySemaphore.Release() ; return; } gives me a concurrent problem. Obviously without semaphores I get a concurrency error also. I use here the semaphore in order to investigate where in the code the problem arises. Normally I cannot use it because of performance problem. Here is Cygwin version I'm using: cygwin 1.3.12-2 gcc 2.95.3-5 gcc-mingw 3_1-20020516-1 I don't use pthreads emulation in order to maintain compatibility to previos versions. So I'm using for multithreading _beginthreadex familly funtions, the same that work using Watcom. Could anyone give me a hint ? Thanks in advance, Ignasi Villagrasa. GRI S.L. -- 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/