LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-15-2004, 11:01 PM   #1
AquamaN
Member
 
Registered: Oct 2002
Location: Ohio, USA
Distribution: OS X 10.4.8, Ubuntu 6.10
Posts: 146

Rep: Reputation: 15
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
 
Old 03-16-2004, 03:45 AM   #2
the_dayi
LQ Newbie
 
Registered: Oct 2002
Location: istanbul
Distribution: redhat
Posts: 16

Rep: Reputation: 0
hi,
as far as i know the only way to pass multiple parameters to pthread_create is by using a struct containing them..
 
Old 03-16-2004, 09:51 AM   #3
AquamaN
Member
 
Registered: Oct 2002
Location: Ohio, USA
Distribution: OS X 10.4.8, Ubuntu 6.10
Posts: 146

Original Poster
Rep: Reputation: 15
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
 
Old 03-16-2004, 10:05 AM   #4
AquamaN
Member
 
Registered: Oct 2002
Location: Ohio, USA
Distribution: OS X 10.4.8, Ubuntu 6.10
Posts: 146

Original Poster
Rep: Reputation: 15
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...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pthread_create... os2 Programming 4 05-26-2005 03:09 PM
error on pthread_create? adamjmac Programming 2 05-23-2005 06:21 PM
pthread_create problem live_dont_exist Programming 5 04-24-2005 06:21 AM
Pthread_create rahul_kulkarni Programming 4 02-10-2005 11:48 AM
pthread_create tushar123 Programming 2 06-07-2004 08:15 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration