in Education by
In C, how can i pass more than one argument to a thread? Normally, I do it in a way like, pthread_create(&th,NULL,dosomething,(void*)connfd); void * dosomething(void *connfd) { // Doing something } In the above example,I am passing connfd value only to the thread 'th'. Is there any way to pass more than one value so that it can be much useful for me? One more thing, Can we pass an array as an argument to a thread? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Pack the several values inside a struct on the heap (so malloc it and fill it before), then call pthread_create with a pointer to that struct.

Related questions

0 votes
    I'm writing an app for Android in Xamarin Forms. I want to navigate the user from one page to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 14, 2022 in Education by JackTerrance
0 votes
    I'm writing an app for Android in Xamarin Forms. I want to navigate the user from one page to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 14, 2022 in Education by JackTerrance
0 votes
    I'm writing an app for Android in Xamarin Forms. I want to navigate the user from one page to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    When there are more than one independent variables in the model, then the linear model is termed as _______ (a ... of R Programming Select the correct answer from above options...
asked Feb 10, 2022 in Education by JackTerrance
0 votes
    A search key containing more than one attribute is referred to as a _________ search key. (a) Simple ... , Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
0 votes
0 votes
0 votes
    An ____________ consists of a search-key value and pointers to one or more records with that value as ... , Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
0 votes
    my tens digit is one more than my hundreds digit. my hundreds digit is an even number between 5 and 7. my ones ... triangle. Who am l? Select the correct answer from above options...
asked Dec 23, 2021 in Education by JackTerrance
0 votes
    A _____________ constraint requires that an entity belong to no more than one lower-level entity set. ... chapter Database Systems Design and Implementation of Database Management...
asked Oct 10, 2021 in Education by JackTerrance
0 votes
    If an entity set is a lower-level entity set in more than one ISA relationship, then the entity ... in section Database Systems Design and Implementation of Database Management...
asked Oct 10, 2021 in Education by JackTerrance
0 votes
    How do we pass command line argument in Eclipse? (a) Arguments tab (b) Variable tab (c) Cannot ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    In some cases, it is found that a large number of colliding molecules have energy more than thereshold value, yet the ... is slow. Why? Select the correct answer from above options...
asked Jan 4, 2022 in Education by JackTerrance
0 votes
    Write the Unconnected lookup syntax and how to return more than one column....
asked Mar 29, 2021 in Technology by JackTerrance
...