This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Question about having msvcrt*.dll and cygwin1.dll in one process


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]