Does anyone know of any examples or tutorials for how to create a pthreads server? I have built a web server using fork() which works fine. I want to convert it to multi threading but I really cannot understand how the variables work in respect to mutexing, i don't understand whether I have to rewrite a lot of the code or just replace the forking sections.

Thanks for any help.