I would that my runner (is a while loop), working in the same moment of the rest of my main program. If I compile and run this program I read only 'Hello'.
I would read Hello BYE Hello Hello Hello.
The program write 'BYE' only If I remove the loop while, and the result is Hello BYE...
do you know how i can fix this problem or same idea? I'm wronging using pthread ?!
pthread_join(t1,&result);
Joining a thrread means "wait untill it is finished". So you won't see output in main.
I suggest to move output before joining and sleep in main for some time to give thread chance to start.
And add synchronisation to the two: standard stream are not thread safe, so you will have problems if you try to write from both threads simultaneously.