OPERATING SYSTEMS ICOMS W4118, Dept of Computer Science, Columbia University
Home | Announcements | Lectures | Homeworks | Grades | Discussion | Resources

  OS Message Boards
  Projects & Assignments
  pthread_create() or clone()

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   pthread_create() or clone()
dsbhagat

Member
posted 11-04-2001 07:20 PM     Click Here to See the Profile for dsbhagat   Click Here to Email dsbhagat     Edit/Delete Message   Reply w/Quote
In Q4 for the programming section are we supposed to use the clone system call to create new threads or can we use pthread_create.

I tried compiling a program using pthread_create and pthread_join and it gave me an undefined refrence for the two functions probably because it says in the hw that
"Pthreads for linux is implemented through kernel level threads (based on clone)." But now my question is if we are to use the clone system call then what do we use for joining the threads because i could not find a matching function.

It just seems from all the documentation on Pthreads in the assignment that pthread_create, pthread_join, pthread_mutex_lock, pthread pthread_mutex_t are the functions/identifiers to be used for this problem. I just do not know which header files they are located in.

Any kind of help on this topic will be appreciated. Thanks in advance for your help.

-Dhiraj

IP: Logged

rvg

Moderator
posted 11-05-2001 04:18 PM     Click Here to See the Profile for rvg   Click Here to Email rvg     Edit/Delete Message   Reply w/Quote
quote:
Originally posted by dsbhagat:
In Q4 for the programming section are we supposed to use the clone system call to create new threads or can we use pthread_create.

I tried compiling a program using pthread_create and pthread_join and it gave me an undefined refrence for the two functions probably because it says in the hw that
"Pthreads for linux is implemented through kernel level threads (based on clone)." But now my question is if we are to use the clone system call then what do we use for joining the threads because i could not find a matching function.

It just seems from all the documentation on Pthreads in the assignment that pthread_create, pthread_join, pthread_mutex_lock, pthread pthread_mutex_t are the functions/identifiers to be used for this problem. I just do not know which header files they are located in.

Any kind of help on this topic will be appreciated. Thanks in advance for your help.

-Dhiraj


My guess is that you forgot to specify the pthread library when you compiled with gcc.

From one of the pages linked on the HW assignment:

"gcc thread1.c -o thread1 -lpthread"

Ravi

IP: Logged

All times are ET (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | Home


Ultimate Bulletin Board 5.45c