[En-Nut-Discussion] Per thread global variables

Ole Reinhardt ole.reinhardt at kernelconcepts.de
Tue Oct 18 21:46:36 CEST 2005


Hi,

> beside having usual local and global variables, I need to have global 
> variables independent for each thread. So I'd like to find some 
> information somewhere that could help me reference these variables in a 
> way similar to:

You could put the variables in one struct and malloc the heap for this 
struct in the first lines of code of your thread. Pass the pointer to 
this struct to every function that uses these variables.

Best regards,

Ole

-- 
kernel concepts    Tel: +49-271-771091-14
Dreisbachstr. 24   Fax: +49-271-771091-19
D-57250 Netphen    E+ : +49-177-7420433
--



More information about the En-Nut-Discussion mailing list