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 7987577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:11:22+00:00 2026-06-04T12:11:22+00:00

I have seen code for summation of an array using threads. In this code

  • 0

I have seen code for summation of an array using threads. In this code a thread is created and an int data type is returned:

int iret1, iret2;   
iret1 = pthread_create( &thread1, NULL, print_message_function, (void*) message1); 
iret2 = pthread_create( &thread2, NULL, print_message_function, (void*) message2);

I knew that a thread is a child of a process and it uses for executing program. For the executing program memory is needed, and memory is returned by a void* data type.

What is the logical reason for returning an int? Can any one explain the actual reason?

  • 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-04T12:11:24+00:00Added an answer on June 4, 2026 at 12:11 pm

    According to man pthread_create:

    Return Value

    On success, pthread_create() returns 0; on error, it returns an error
    number, and the contents of *thread are undefined.

    That value simply indicates whether the thread creation was successful or not.

    It is not a memory allocation call like malloc, therefore I don’t see why you think it should return a pointer.

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

Sidebar

Related Questions

I have seen code like this (actually seeing another person type it up): catch
recently I have seen this code arrMove = new List<int[]>(4); m_pppiCaseMoveDiagLine = new int[64][][];
I have seen code like this: struct failed_login_res { string errorMsg<>; unsigned int error;
I have seen this code Sortable JqGrid using LINQ to MySQL (DbLinq) and Dynamic
In our application, I have seen code written like this: User.java (User entity) public
I have seen this code documented in the tk docs, but I can't figure
Recently I have seen this code in a WebSite, and my question is the
I have seen in some source code (by other developers) something like this: #import
I have seen code like this package xyz; # putting the module inside its
I have seen code which use vector, vector<int>s; s.push_back(11); s.push_back(22); s.push_back(33); s.push_back(55); for (vector<int>::iterator

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.