creating and reaping joinable peer threads

This is a discussion on creating and reaping joinable peer threads within the C Programming forums, part of the General Programming Boards category; I need to modify the verion of my code below to create and reap a user defined number of joinable ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,452
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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-03-2003, 11:21 PM
  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


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21