Mail Archives: djgpp/2000/01/26/09:46:40
On 26 Jan 2000, Alain Magloire wrote:
> reentrancy: system calls, the same buffer is use for all systems. So
> if one thread does, let say a read() and the otherone a readdir()
> they may intertwine, or something like that I was told.
This latter aspect is not a problem in the DJGPP case, because signals in
general, and timers in particular, are deferred until the system call
returns. This is because the DJGPP signal machinery is based on
triggering an exception in such a way that it only happens when the
program is in protected mode and touches some of its data.
The price for this is that if a program is parked inside a DOS call, like
if it reads from the keyboard, the signals (and threading that is based
on SIGALRM) are not delivered until the DOS call returns. So, for
example, if you spawn a subsidiary program, threading stops until the
child program returns.
- Raw text -