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
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to