|
-
December 30th, 2005, 02:52 AM
#1
Is using Sleep an ideal solution here?
Hi all,
I have made a multithreaded server that sends client the updates
of its desktop. Server uses a seprate thread that gets updates
and then send them to client through socket. I have used
an infinite while loop in that thread that breaks when client disonnects
and in each iteration of loop i get updates and sends if there is any.
After sending one update i have used a Sleep of 50ms so that there
should be a delay in next update send. If i dont used the sleep then
server thread will continuously get screen updates and sends them.
This causes my CPU usage on server near to 100%. To avoid this i have used
sleep. Is that sleep duration is ideal or poor approach?
Or i can use more sleep duration.
I havent any idea how much sleep is ideal in real time applications.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|