Subj : Re: returning arguments To : comp.programming.threads From : Huub Date : Mon Jun 27 2005 03:51 pm Joe Seigh wrote: > Huub wrote: > >> Hi, >> >> I have written programs on Slackware Linux in C++, each program uses a >> thread. In two of these threads I read a boolean, in one I read an >> integer. Like this; >> >> void *Draad(void *threadid) >> { >> read sensor; >> return data; >> } >> >> main() >> { >> rc = pthread_create(&threads[1], NULL, Draad, (void *)tasdk_id); >> } >> >> I know this isn't compilable code, but it's just to give an idea. My >> question(s): >> - Do threads *have* to be void? > > void * > >> - Can I pass on return values directly from the thread? > > ? > >> - If not, how do I pass them on? > > man pthread_join > >> >> I hope my question is clear enough. > > > It's not clear why you are using threads for this. You should become > more familiar with standard thread usage patterns, why they're used, and > what they > buy you. > I use a thread for this since I have to constantly read from or write to an interface. In this thread is a while loop, for continuing reading or writing. .