Thread: pthread hanging

  1. #1
    Registered User
    Join Date
    Dec 2006
    Posts
    136

    pthread hanging

    hi all
    i am doing a gui application using pthread
    if i do like this my application is not hanging.
    Code:
          pthread_t thread;
          gint  iret1;
          iret1=pthread_create( &thread, NULL, write_data, NULL);
    and if i do like this my application is hanging
    Code:
          pthread_t thread;
          gint  iret1;
          iret1=pthread_create( &thread, NULL, write_data, NULL);
          pthread_join( thread, NULL );
    and also what is the deference b/w
    pthread_exit(NULL) and
    pthread_exit(0);

    but i need to join the thread.
    can you help me

    how can i solve this problem

    thank you in advance

  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
    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. pthread question
    By quantt in forum Linux Programming
    Replies: 7
    Last Post: 04-07-2009, 01:21 AM
  2. pthread hanging
    By munna_dude in forum C Programming
    Replies: 7
    Last Post: 05-17-2007, 08:51 AM
  3. The Pthread Hell
    By matott in forum Linux Programming
    Replies: 1
    Last Post: 04-10-2005, 05:59 AM
  4. pthread priority
    By condorx in forum C Programming
    Replies: 2
    Last Post: 04-02-2004, 08:54 PM
  5. pthread create and join problems
    By rotis23 in forum C Programming
    Replies: 1
    Last Post: 10-11-2002, 08:41 AM