[fpc-devel] OO rewrite - technical questions

Michael Schnell mschnell at lumino.de
Tue Jul 20 11:31:50 CEST 2010


  On 07/19/2010 08:33 PM, Hans-Peter Diettrich wrote:
>
> Windows uses segment registers in exception handling, i.e. it should 
> be possible. But the segment descriptor/selector must point to the 
> correct thread-memory address in the address space, what can not be 
> achieved in application code.
>
If Windows sets the segment registers and the application is not 
supposed to modify them (and assume them to be restored after 
preemption), maybe one of them is a pointer to some thread-dedicated 
memory area, that by can be used (or is used by the OS) to hold a 
pointer to the threadvars or to hold the threadvars themselves (if the 
size of the threadvar area is denoted in the exe file and thus known to 
the OS, which might kindly allocate it when a thread is created).

-Michael



More information about the fpc-devel mailing list