X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=cxl ZZDF1uxPk8OGeZUXUXIHRsY2+FW4/QtwQIYsXB0IX55y+peI7Ug208ompLV7ENKH o1sPjnbeypIR4P+cVblaoOoP0+oP0sxvI+Puz99VlmLizXJnDNLM8MaIC6j1B7Dr W3YeYyHsioO1kISBQQ7YRbt9W7UiE7X3xORgTzCg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:mime-version :content-type:content-transfer-encoding; s=default; bh=WE2JLd4Ay 5elsRut42nqrUmy2kc=; b=TQfE2jdVndCShcJrcbojsE5BcTHFoSyE/bQ8OK51Q DGMvQuPrqyS/vl87KG0sMj7ie54x2sBkMWlC2vSmWqr4RBOzu4RTz74e2LuQ2MU9 Ny0ZrVhSEAzcvDM0g4330UYQvCfxdJk/TXUXyRQ0qL452HDUsuk8R4oF9NpSlie0 s8= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: plane.gmane.org To: cygwin AT cygwin DOT com From: Soren Hein Subject: Linking to multi-threaded MinGW DLL from Cygwin Date: Mon, 9 Jun 2014 08:53:40 +0000 (UTC) Lines: 23 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: Loom/3.14 (http://gmane.org/) X-IsSubscribed: yes I have a third-party, multi-threaded DLL (with .h file and .def file) that has been compiled using minGW. The DLL uses the Windows threadpool API. I want to use this DLL from Cygwin. What I'm actually doing is linking to this DLL from Perl XS code, and functionally speaking, this now works fine. (I had to make sure to use __stdcall from the Cygwin side.) I use gcc/g++ v4.8.2. Now that it works, I'm getting greedy and I want to take advantage of the multi-threading on the DLL side, since there is a great deal of parallelism in the function that the DLL performs. I shouldn't have to do anything on the Cygwin side to achieve this. And yet the DLL is behaving in a single-threaded way and not showing the speed-up that it should. I'm wondering if two threading models are colliding here, but then the DLL doesn't fail completely. When compiling the XS code, there is a flag that I don't understand called "-I/usr/lib/perl5/5.14/686-cygwin-threads-64int/CORE" which sounds a bit ominous. I've tried -mno-cygwin since I read about that, but that doesn't seem to work anymore. Any help for a newbie is appreciated. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple