Re: no free functions?!
- From: Georg Bauhaus <see.reply.to@xxxxxxxxxxxxxxxxxx>
- Date: Sun, 18 May 2008 14:58:33 +0200
nicolas.edel@xxxxxxxxx wrote:
On 14 mai, 12:53, Georg Bauhaus <rm.dash-bauh...@xxxxxxxxxxxxx> wrote:
E.g., the errno variable and
similar variables are connected to the funcions by
man pages only; try using them reliably in multithreaded
programs.
What's the problem with using errno reliably in multithreaded
programs ? Any decent libc implementation support that quite well
using TLS and dereference :
bits/errno.h:42:# define errno (*__errno_location ())
Actually, you are proving my point: While shared variables are
not available as a C concept, TLS provides exactly the modular
setup to which I had been referring[*]; you don't see the
modularization, though. Alas, for C use, TLS is a non-portable
OS-concept, and "thread" it is not built into the language
and therefore no information for the C compiler. Eiffel,
properly implemented, has support for concurrent and parallel
programming built in via "separate" and associated semantics
(see e.g. SCOOP).
Multiprogramming looks like an old concept, and languages older
than C and cousins have typically supported multiple threads and
shared variable protection right in the language. Luckily, some of
this old wisdom will now be preserved because the multicore CPUs
provide an incentive to again become familiar with semaphores,
monitors, CSP, etc..
[*] errno is just a good example for the more general shared
variable that needs protection from concurrent access. It hadn't
always been a matter of course for a C library to be thread
safe!
.
- Follow-Ups:
- Re: no free functions?!
- From: Ulrich Windl
- Re: no free functions?!
- From: nicolas . edel
- Re: no free functions?!
- References:
- no free functions?!
- From: jhc0033@xxxxxxxxx
- Re: no free functions?!
- From: Georg Bauhaus
- Re: no free functions?!
- From: nicolas . edel
- no free functions?!
- Prev by Date: Re: no free functions?!
- Next by Date: Re: no free functions?!
- Previous by thread: Re: no free functions?!
- Next by thread: Re: no free functions?!
- Index(es):
Relevant Pages
|