Wednesday, May 02, 2007

Programming pthread under different Linux distributions

This time a bit far from FreeBSD.
I've noticed that using exit() function in thread may cause different action. Under Ubuntu it kill not only running thread but also a parent process. Under monoppix it kills only a thread which called this function.
Strange behaviour, but how pthread works? In fact creating threads in pthread create a new process like fork() function, and using exit() may work like exiting process which called it or killing also a parent process for thread.

Labels: