public inbox for
 help / color / mirror / Atom feed
From: "Pedriana, Paul" <>
To: "Mark Weaver" <>, <>
Subject: RE: [pthreads-win32] How can you use errno with pthreads DLL?
Date: Wed, 19 Nov 2003 23:37:00 -0000	[thread overview]
Message-ID: <> (raw)

   >>1. Recompile pthreads against the same runtime 
   >>library that you are using rather than MSVC.  
   >>This is more than likely the best solution as 
   >>having two different CRTs is nasty bloat: think 
   >>two separate heaps and copies of all support data 
   >>structure, not to mention the additional code size.

This is a good idea which would work. I might point out that 
we don't use the CRT for the most part; it is somewhat non-portable
(can't rely on half of the useful stuff existing elsewhere)
and not necessarily very efficient (with some exceptions), 
and we need both. So duplicating CRTs really has little ill 
effect for us. Also, VC++ no longer uses its own heap but 
rather redirects all allocations to the OS under WinXP and 
later OSs. 

   >>2. Explicitly import and use the function "_errno" 
   >>from MSVCRT.DLL.

OK, this is a good idea too. I was just hoping that pthreads 
could simply make such a thing available itself, as IMO it is 
not a good idea for a utility library to force the apps that 
use it to use a particular library configuration (in particular
one that has a history of causing problems for commercial software
developers due to problems with that way Windows deals with linked
libraries). What happens if I have another DLL from somebody 
else that has the exact opposite requirement (must use own CRT 
and not shared one)? 

   >>sem_* and sched_* do, so if you don't use those you 
   >>could bypass this problem.

Yah, it's the semaphore functions that write to errno and the ones
that are an issue for me. I thought I read somewhere that there was
a proposal to migrate sem_* to return error values and zero upon 
OK, but that's another story.

Thanks so much for the response. I will find a way to do one of the 
above or add my own GetErrno function to my copy of pthreads. I find
that pthreads-win32 is a great thing and am very grateful for the 
work that has been put into it.

             reply	other threads:[~2003-11-19 23:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-19 23:37 Pedriana, Paul [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-11-19  3:45 Pedriana, Paul
2003-11-19  6:27 ` Mark Weaver

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).