X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; q=dns; s=default; b=C4 Mcx7idQnrm9eLaoPOwm4mlt9PDks61xasb87w14EXXWMyD+UQWtBu6xROIbcN0wI jH4bI8sYfKBcYVkX/G5wAvaKyGb3hrQ0zUe7E40Gnviz8wxipKcqcOZ8nA2wfvHv F2S1vnLHjMVc7XEo4jajEeN9PDYDT7jbLkGmCS82E= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; s=default; bh=KZJBPbb5 35VCpr0x2J6pMHNktrQ=; b=aRy9kg64eYBa/FihBRUpr2Jc22bAs3epfPqeou7f QUJvKjzFBx3xvJ+1zPvJ13ToZXPMSx7cWUQODPYnFQoKfomYDWk2m3CQbxENK6wA GmuBtvc+0jx5X956InrFcnDaUO0nG8sgKUJ4W7Sl4d3gZgfuB80wR9xUJCg3AO1d heg= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,UNSUBSCRIBE_BODY autolearn=no version=3.3.2 X-HELO: mail-wg0-f49.google.com MIME-Version: 1.0 X-Received: by 10.194.60.45 with SMTP id e13mr39485855wjr.109.1416233389495; Mon, 17 Nov 2014 06:09:49 -0800 (PST) In-Reply-To: References: Date: Mon, 17 Nov 2014 09:09:49 -0500 Message-ID: Subject: Re: Question about having msvcrt*.dll and cygwin1.dll in one process From: cyg Simple To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes On Mon, Nov 17, 2014 at 4:48 AM, Jan Nijtmanswrote: > 2014-11-17 9:47 GMT+01:00 Jing Zhao : >> 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: > Certainly lucky and usually won't work on all systems or even the same system consistently. > - 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) > Memory control is the biggest issue. Two different runtimes controlling the same memory segments will not work! -- cyg Simple -- 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