[fpc-devel] Off-topic: Threadvar in C

David W Noon david.w.noon at ntlworld.com
Fri Aug 1 15:56:35 CEST 2008


On Fri, 2008-08-01 at 14:14 +0200, Michael Schnell wrote:

> Sorry to bother you by asking this here, but I don't know a better place. :(

You could try Usenet: comp.os.linux.development.apps

> I need to port a multi-threaded program in ANSI C. From a propriety OS 
> to Linux.
> 
> Here the same code is started in multiple threads.
> 
> The OS provides a global variable that is preloaded with a "thread 
> number" of the running thread  (1, 2, 3, 4, .... n). This is something 
> like a threadvar and can e.g. be used to create an array of records that 
> holds thread specific values.
> 
> Now in Linux I  need to use the pthread library. Here I don't find 
> informations on how to hold thread specific values.

man pthread_setspecific

man pthread_getspecific

could be good places to start.

Regards
Dave [RLU#314465]
======================================================
david.w.noon at ntlworld.com (David W Noon)
======================================================




More information about the fpc-devel mailing list