LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   pthread_create parameters (https://www.linuxquestions.org/questions/programming-9/pthread_create-parameters-158248/)

AquamaN 03-15-2004 11:01 PM

pthread_create parameters
 
Hello.

Is it possible to pass more than one argument to the thread when you use pthread_create(...)?? Everything I have read on it says just one, but no where does it say you can have ONLY one. Also, if it is not possible to send more than one, any ideas on how to use variables that were created in Main() and could not have been made global (taken in from command line)? Thanks for any insight!!

-AquamaN

the_dayi 03-16-2004 03:45 AM

hi,
as far as i know the only way to pass multiple parameters to pthread_create is by using a struct containing them..

AquamaN 03-16-2004 09:51 AM

Yeah, I know of that way too but I am taking in variables from the command line in main() so I can not create the struct using those variables (or atleast as far as I know I can't.) Thanks for your response.

-AquamaN

AquamaN 03-16-2004 10:05 AM

Wow... I'm a tool. I failed to realize that I could just pass them into the struct as I take them into the main function... duh...


All times are GMT -5. The time now is 09:47 PM.