Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7915647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:31:28+00:00 2026-06-03T14:31:28+00:00

pthread_t single_thread ; pthread_create (&single_thread , NULL , &mywriter , 0) ; void *

  • 0
pthread_t single_thread ;
pthread_create (&single_thread , NULL , &mywriter , 0) ;
void * ignore ;
pthread_join (single_thread , &ignore) ;

I have this code above, what is the purpose of defining void* ignore and do join of it?
I get a segmentation fault while using it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:31:30+00:00Added an answer on June 3, 2026 at 2:31 pm

    The point of the second argument is to get the returning argument from the thread.

    Something like an exit code. But since this could also be the address of an object you are returning it is a void** so you can modify the void*. If you look at the signature it is actually a void** that the function expects and you are passing to it.

    If you don’t need it, as i think is your case. Just pass null

    On return from a successful pthread_join() call with a non-NULL value_ptr argument, the value passed to pthread_exit() by the terminating thread is made available in the location referenced by value_ptr.

    Man: pthread_join

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using C++. pthread_t threads[STORAGE]; // 0-99 ... void run() Error>>> int status = pthread_create(&threads[0],
I use threads in C as follows: pthread_t thread; if (pthread_create (& thread, NULL,
I've come across this piece of code inline pthread_t CreateThread(void(*pfn)(void*), void* parg, bool fWantHandle=false)
I am working on a network programming and I have this code void WorkHandler::workLoop(){
see i have code like #include<stdio.h> #include<pthread.h> #include<string.h> void* thread_function(void) { printf (This is
Given the following: pthread_t thread; pthread_create(&thread, NULL, function, NULL); What exactly does pthread_create do
The function header for pthread_create looks like this: int pthread_create(pthread_t * thread, const pthread_attr_t
int pthread_create(pthread_t *restrict thread, const pthread_attr_t *restrict attr, void *(*start_routine)(void*), void *restrict arg); I
code: local void* s_accept_connections(tmpsock) void* tmpsock; { int32_t newfd; int32_t tmp; SOCKADDR_IN newsockaddr; pthread_t
I am running the same exact code that I ran in plain C: pthread_create(&threads[i],

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.