This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Question about having msvcrt*.dll and cygwin1.dll in one process
- From: Jan Nijtmans <jan dot nijtmans at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 17 Nov 2014 10:48:13 +0100
- Subject: Re: Question about having msvcrt*.dll and cygwin1.dll in one process
- Authentication-results: sourceware.org; auth=none
- References: <OFA16137E6 dot A98D47F2-ON48257D93 dot 002FE9C9-48257D93 dot 00304419 at ni dot com>
2014-11-17 9:47 GMT+01:00 Jing Zhao <jing.zhao@ni.com>:
> The outputs:
> welcome to linux world
> res: 7777777
> it's over
>
> So everything look fine. According to the FAQ 6.15, is there anything
> that's potentially dangerous that I should be aware of, when linking both
> msvcrt.dll and cygwin1.dll? Thanks a lot!
If it works, then you are simply lucky. Some pitfalls I know off:
- when using stdin/stdout/stderr, msvcrt and cygwin1.dll have
their own implementation, which might conflict: locking over
multiple threads works differently, buffering is different. So
if both your application and the dll write to stdout, the
order in which both outputs are intermixed is not guaranteed.
- exception handling is different. Don't expect an exception being
thrown in the dll to be handled gracefully in the application.
- threading functions are different, same story.
- dll initialization is different (recently a bug was fixed
regarding this, in a pre-fix version of cygwin1.dll your
current example might simply crash)
That are just 3 pitfalls I know of, I'm sure there are more.
So in stead of stating that it doesn't work, a better formulation
would be that it is unsupported. But don't expect any
fundamental help here, it's tricky stuff (apart from the
question who really would want this .......)
Regards,
Jan Nijtmans
--
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