• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

multithreading problem in C++

HJB417

Senior member
in gamespy, it can ping up to 64 servers simultaneously. It uses multithreading, 1 thread per ping but the CPU utilization is close to nothing. I tried to follow the same pattern but my cpu utilization stays at 100 until all the pings are done. I made all the ping threads background threads and putting the main thread to sleep until all the worker threads were done but it still stays at 100% cpu utilization while pinging.
Can anyone help?
 
It has nothing to do with multithreading but rather with your program design. Most probably it's related to how you're invoking ping.
 
Also remember Gamespy pings aren't just ICMP echo requests, they connect to the server and get the info on players too, so they probably use the same method quake uses via udp to determine your latency.
 
good points..
hmm.
but quake goobles up all your cycles anyway =0
true about gspy connecting to udp, and the almost all the ips on the list are respondable game machines...

about my invoking of ping, this is what my worker thread looks like.
I'm just trying to make a d2 game finder
1. ping all possible ips of my range. add ones that ping in 10ms or less to a file
2. loop the file connection to port 4000
3. trigger event when a connection to port 4000 has been made.

also, how can I find the IP range my school uses? Right now, I'm scanning 64000 IPs but there are at most, 2,500~3,000 computers here. =(
 
Back
Top