comp.lang.ada
 help / color / mirror / Atom feed
From: "Björn Lundin" <bnl@tiscali.se>
To: comp.lang.ada@ada-france.org
Subject: Re: Gnat 3.4.2 tasking errorcodes windows
Date: Tue, 18 Jan 2005 19:52:48 +0100
Date: 2005-01-18T19:52:48+01:00	[thread overview]
Message-ID: <mailman.66.1106074394.527.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: <kKadnf42BKeeq3HcRVn-hQ@megapath.net>

måndag 17 januari 2005 23:04 skrev Randy Brukardt:
> "Björn Lundin" <bnl@tiscali.se> wrote in message
> news:mailman.65.1105991123.527.comp.lang.ada@ada-france.org...
> ...
>
> > What I wonder is why I can get the correct errorcode by calling
> > WSAGetLasterror (which is what Gnat.Sockets.Thin.Socket Errno does, just
> > pragma import) when having no tasks, but not when having tasks.
>
> I wouldn't expect that to work. WSAGetLastError isn't necessarily
> thread-safe: I believe that there is only one global copy per process. 

Hmm, not according to:
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/wsagetlasterror_2.asp>

In short from the webpage:
Return Values
The return value indicates the error code for this thread's last Windows 
Sockets operation that failed.
Remarks
The WSAGetLastError function returns returns the last error that occurred for 
the calling thread. 


So Microsoft thinks it's thread/task safe and it is if I use Object Ada. Now, 
I'm (my company) is moving from Object Ada to Gnat, but this one is a 
showstopper :( (We already did the transition on Aix, and I like gnat more 
than OA)

Nicolas explained to me that what I want will not work with 3.15 or with 
3.4.2 :( but the explanation of libaddress2line was good news. 


> I would guess that the reason that Gnat.Sockets.Thin directly accesses via
> Import is that it assumes no tasking issues. In any case, why access this
> directly? You're just asking for trouble, by making yourself rediscover
> things that the binding writers already did.
I dont' use gnat.sockets directly, I use a 10 year old homemade interface, 
that works with other compilers and operating systems, and won't break legacy 
code in production on several sites. 
The sample I sent was to illustrate my problem with known 'standardcode'

/Björn
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada-france.org
> http://www.ada-france.org/mailman/listinfo/comp.lang.ada



  parent reply	other threads:[~2005-01-18 18:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-17 19:44 Gnat 3.4.2 tasking errorcodes windows Björn Lundin
2005-01-17 22:04 ` Randy Brukardt
2005-01-17 23:17   ` tmoran
2005-01-18 18:52   ` Björn Lundin [this message]
     [not found]   ` <200501181952.49091.bnl@tiscali.se>
2005-01-18 21:26     ` Stephen Leake
2005-01-18  0:33 ` Jeff C
2005-01-18 18:55   ` Björn Lundin
2005-01-18 14:44 ` Craig Carey
2005-01-18 16:34   ` Nicolas
2005-01-18 18:54     ` Björn Lundin
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox