when you create thread using thread_create and pass the function, does the function goes forever if there is infinite loop in the function?
eg
for(;;){
//dosomthing
}
Does the thread keep “do somthing” until the thread is destroyed or the program is finished?
Thanx
When you invoke thread_create() the thread that gets created will itself invoke the function you passed. So for example:
will make a new thread and the new thread will run the function thread_do().
If now you have previously defined thread_do() as:
then the thread will go to an endless loop indeed.