I am writing a program that will be multi-user and have implimented sockets, one of the things I will have the program do is scan the Arraylist of sockets and check to make sure they are still connected, and if not then remove them from the program.
My question is, should I do this in a seperate thread or put it loop into the main game while true loop?
I ask this because I already use 2 seperate threads (the main flow loop and a socket connection loop) and I don't yet know if if there is such a thing as too many seperate threads running at the same time?
My assumption is that the threads are less strain on the program than a linear writing style but I was hoping for some clarification..
Thank you for any advise