Hi joseph,
Are you sure that you are using an empty infinite loop for GUI refresh? Any specific reason for that? I
guess that this
might be the reason behind 100% CPU utilization (though I'm not getting why it should blow up both cores)
Also, is it really necessary to refresh GUI in real-time? How about sleeping for, say, 500 milliseconds?
Besides that, for this specific problem, I would like to recommend
Java Network Programming by Harold. Its pretty nice book, and I referred to it when I wanted to develop a small chat system - where server would entertain multiple clients in multithreaded environment and so on.
For threading best practices, I would suggest below books:
1)Java Concurrency in Practice by Bloch et.al. An excellent book in understanding Java threading framework in general. Also discusses some threading issues as well.
2)Java Threads by Wong et.al. If you are new to Java threads, this should be your first book. Easy to understand, practical and very handy.
3)Taming Java Threads by Holub. This should be referred when you are developing real life multithreaded applications and want to squeeze maximum output off Java threads.
I hope this helps.