[fpc-pascal] Threading in FPC DOS

Andreas Berger Andreas at TheBergerClan.org
Wed Jul 12 02:34:32 CEST 2006


>> I need to implement some simple threading in a DOS application I am 
>> writing with FPC. What I need to know is the following:
>>
>> 1) Does FPC protect it's stack or can I allocate memory from the heap 
>> and point SS and ESP to it for the threads stack.
>>     
>
> I believe the latter is correct (except that no 
> SS change should be needed), at least this is how 
> it works for other targets as far as I know. 
> Amount of memory to be allocated for stack is 
> passed as a parameter during thread creation.
>   
Oh, so all the segments are the same in FPC? I mean CS = DS = SS? That 
would really be swell.
> BTW, in case you manage to create thread manager 
> (systhrd.inc implementation) for GO32v2 target 
> and are willing to share it with others, we'd be 
> certainly interested to add it to FPC.
>
>   
Hmm, I had thought to implement the TThread class. What is systhrd.inc? 
It seems to be implemented with different methods for each target.

Andreas




More information about the fpc-pascal mailing list