Computing.Net > Forums > Programming > Creating Thread (operating systems)

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Creating Thread (operating systems)

Reply to Message Icon

Name: insangre
Date: October 7, 2007 at 14:23:00 Pacific
OS: windows xp home
CPU/Ram: 2.0 ghz 1025 mb
Product: sony vaio
Comment:

Hi. I am using pthread_create() to handle a File handler. I am not having luck in passing the argument properly. I think its a pointer issue.

File * openFile

pthread_create(&tid,NULL,countLines,(void *) &openFile);


void *countLines(void *arg){}

the thread is created but the i cant seem to work with the openFile in the countLines() function passed. thanks



Sponsored Link
Ads by Google

Response Number 1
Name: Guy
Date: October 9, 2007 at 16:09:00 Pacific
Reply:

Hunh. I think .........

In your call to pthread_create, 4th parameter does not need the 'take address of' (&) operator.

Try just:

(void *) openFile

for that parm.



0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Creating Thread (operating systems)

New Operating system to replace Win www.computing.net/answers/programming/new-operating-system-to-replace-win/3879.html

maximum operating systems www.computing.net/answers/programming/maximum-operating-systems/5669.html

Operating Systems www.computing.net/answers/programming/operating-systems/11432.html