Thread: pthread_create() Problem..

  1. #1
    Registered User
    Join Date
    Feb 2006
    Posts
    22

    pthread_create() Problem..

    Hi All,
    i am getting the following error while compiling the program :

    ERROR; return code from pthread_create() is 251

    Is anyone have idea what could be the reason or when error number 251 is coming ?

    following the loop where i m calling the pthread_create function.

    for(t=0;t<NUM_THREADS;t++)
    {
    printf("Creating thread %d\n", t);
    rc = pthread_create(&thread[t], NULL, fn_process, (void *) t);
    if (rc)
    {
    printf("\n ERROR; return code from pthread_create() is %d\n ", rc);
    exit(0);
    }
    }

    pls help me to sort out.

    thanks.

  2. #2
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Did you compile with -lpthread ? My source indicates that error 251 appears to be
    Code:
    #define ENOSYS          251     /* Function not implemented     */
    although I can't confirm this. I don't have a POSIX threads library.

  3. #3
    Registered User
    Join Date
    Feb 2006
    Posts
    22
    thnx a lot . i was nt using -lpthread while compiling.Now its running fine.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM