public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Linking to multi-threaded MinGW DLL from Cygwin
@ 2014-06-09  8:55 Soren Hein
  2014-06-09  9:44 ` sisyphus1
  2014-06-09 16:29 ` Larry Hall (Cygwin)
  0 siblings, 2 replies; 3+ messages in thread
From: Soren Hein @ 2014-06-09  8:55 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-09 16:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-09  8:55 Linking to multi-threaded MinGW DLL from Cygwin Soren Hein
2014-06-09  9:44 ` sisyphus1
2014-06-09 16:29 ` Larry Hall (Cygwin)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).