Question about having msvcrt*.dll and cygwin1.dll in one process
Jan Nijtmans
jan.nijtmans@gmail.com
Mon Nov 17 09:48:00 GMT 2014
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
More information about the Cygwin
mailing list