[fpc-devel] fpfork

Jonas Maebe jonas.maebe at elis.ugent.be
Mon Feb 11 12:51:13 CET 2008

On 11 Feb 2008, at 12:16, Michael Schnell wrote:

> Jonas Maebe wrote:
>> In some cases memory is still allocated between the fork and the  
>> exec. You cannot use vfork in such a case. That code still has to  
>> be rewritten so it does not allocate any memory.
> Do you suggest that some improvement should be done there ?


> Of course I will try to do this for the other architectures once  
> I'll get started with that task and fully understand the  
> implications. I feel that a better solution would be e.g. to drop  
> the fpVFork function altogether and do the difference (if necessary  
> at all) in the fpFork function.

I don't understand what you mean here. Both vfork and fork have  
certain semantics, and you cannot replace one with the other in all  

>>> - vfork seems to be used in BSD and SUNOS. Why just in these  
>>> systems ?
>> Correction: it is only used on those systems if the RTL is libc- 
>> based. And the reason is that our thread variable implementation  
>> and its use in the syscall implementations conflicts with using  
>> vfork.
> Don't you use the pthread library for the implementation of pascal  
> threads ?

Yes. But thread variable support is more than just calling some  
libpthread functions.


More information about the fpc-devel mailing list