About busy loop and threading...
I am writing a multithreaded server. I am using pthread library. If my server contains a busy loop, (either sem_trywait or while(1) kind of construct), response of the server is pretty much as expected. But if I change a logic and remove busy looping by blocking, Server doesnt response. If I keep busy looping, top shows cpu usage up to 100%.
I am using livemedia library. Server will respond by starting RTP session. This RTP session is not getting started if there is no busy loop in the system. Dont know where to look for. Can anybody explain what is happening in reality? Is it a problem with my application or problem with thread scheduling on linux.
Also I want to know whether Linux threads are in user space or kernel space. i.e. If thread blocks, then will entire process will block?