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

* Re: Linking to multi-threaded MinGW DLL from Cygwin
  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)
  1 sibling, 0 replies; 3+ messages in thread
From: sisyphus1 @ 2014-06-09  9:44 UTC (permalink / raw)
  To: cygwin, Soren Hein

-----Original Message----- 
From: Soren Hein

> 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"

That just adds /usr/lib/perl5/5.14/686-cygwin-threads-64int/CORE to the list 
of directories that will be searched, looking for header files (that have 
been #include 'd in the code).

That's the location where the perl headers (such as perl.h and xsub.h) 
reside, and XS code normally #include 's those headers .

Cheers,
Rob 


--
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

* Re: Linking to multi-threaded MinGW DLL from Cygwin
  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)
  1 sibling, 0 replies; 3+ messages in thread
From: Larry Hall (Cygwin) @ 2014-06-09 16:29 UTC (permalink / raw)
  To: cygwin

On 06/09/2014 04:53 AM, Soren Hein wrote:
> I've tried -mno-cygwin since I read about that,
> but that doesn't seem to work anymore.

That switch has been removed in favor of actual (32 and 64
bit) cross-compilers targeting native Windows.  If you're
actually targeting Cygwin's perl, then you don't want the
cross-compiler anyway.

-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

--
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).