Tak for oplysninger. Det er fjong.
Leif.
"Claus Pedersen" <cped00@kom.auc.dk> skrev i en meddelelse
news:Pine.GSO.4.21.0205201927120.21844-100000@zil.kom.auc.dk...
> On Mon, 20 May 2002, leif wrote:
> > #define _REENTRANT
> >
> > Er der nogen der kender noget til denne REENTRANT, og evt. kan henvise
til
> > noget dokumentation for dette.
> >
>
>
http://www-linux.gsi.de/~go4/HOWTOthreads/howtothreads.html
> - giver følgende definition på dét, at en funktion er reentrant:
>
> Reentrant
> A function is reentrant if it will behave correctly even if a thread of
> execution enters the function while one or more threads are already
> executing within the function. These could be either the same thread, in
> the case of recursion, or different threads, in the case of
> concurrency.
>
>
>
> www2.linuxjournal.com/lj-issues/issue61/3138.html
> - giver følgende eksempel om brugen af #define _REENTRANT:
>
> What about the value of the global variable errno? Let's suppose we have
> two threads, A and B. They are already running and are at different
> points inside the thread. Thread A calls a function that will set the
> value of errno. Then, inside thread B, it will wake up and check the
> value of errno. This is not the value it was expecting, as it just
> retrieved the value of errno from thread A. To get around this, we must
> define _REENTRANT. This will change the behavior of errno to have it
> point to a per-thread errno location. This will be transparent to the
> application programmer. The _REENTRANT macro will also change the
> behavior of some of the standard C functions.
>
>
>
> Et hurtigt "Google-søg" eller to giver et væld af links til
> trådprogrammering, libraries og deslige, og hvis du på
www.amazon.com
> søger på ordene: "multiprogramming" eller "parallel programming" eller
> "threads programming" får du en hel del bogtitler om programmering med
> tråde.
>
> Jeg ved ikke om dette overhovedet kan hjælpe dig, men i det mindste kan du
> vel bruge det som inspiration til at lede videre.
>
> Venlig hilsen
> Claus Pedersen
>
>