Thread: creating and reaping joinable peer threads

  1. #1
    Registered User
    Join Date
    May 2011
    Posts
    1

    Question creating and reaping joinable peer threads

    I need to modify the verion of my code below to create and reap a user defined number of joinable peer threads. Here is what I have thus far:
    Code:
    #include "csapp.h"
    void *(void *vargp);
    
    int main()
    {
    pthread_t tid;
    Pthread_create(&tid, NULL, thread, Null);
    Pthread_join(tid, NULL);
    exit(0);
    }
    
    void *thread(void *vargp)
    {
    printf("Hello\n");
    return NULL;
    }

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Perhaps you could post something you compiled (what you posted would not compile).

    Then perhaps make use of a for loop (or at least show us how you choose 'a user defined number')
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. peer to peer wifi communication
    By odysseus.lost in forum Networking/Device Communication
    Replies: 2
    Last Post: 07-20-2006, 04:51 AM
  2. Developing Peer-to-Peer App...
    By Dragon227Slayer in forum C# Programming
    Replies: 2
    Last Post: 09-01-2004, 04:31 PM
  3. OOP for DirectPlay Peer to Peer program
    By curlious in forum Networking/Device Communication
    Replies: 0
    Last Post: 11-04-2003, 12:21 AM
  4. Peer-2-Peer spam filter for Outlook!?!?
    By gicio in forum Tech Board
    Replies: 7
    Last Post: 09-23-2003, 12:26 PM
  5. Problem with Peer-Peer Networking with XP Pro
    By Davros in forum Tech Board
    Replies: 14
    Last Post: 10-03-2002, 09:09 AM

Tags for this Thread