Moderator
|
KT probably closed it, but the actual socket has not yet been removed from the list.
poll has a timeout like select, but things certainly need to be tweaked. I have been tweaking KT's performance on a LAN and managed to bump up the upload speed over a LAN to 6 MB/s. The poll changes will be included with this commit. The actual timeout you pass to poll or select has significant impact on upload speeds. With a 1 ms timeout, I manage to get up to 6 MB/s. However this 1 ms timeout increases CPU usage when you are downloading. Though, seeing that I have put the priority of the uploading thread to IdlePriority (i.e. every other process has higher scheduling priority, and the networking thread is only run when no other processes want the CPU), higher CPU usage shouldn't be that much of a problem.
Yeah, I will figure something out. |
Registered Member
|
I haven't looked at the code in excruciating detail, but I'm not sure how thats possible. Should the class not be removed asap upon closure? Hmm, I've never used poll myself, I always just assumed it immediately returned once its scanned the sockets you gave it. Instead of sitting waiting for data, or a timeout. Meaning the programmer has to sit in a loop calling poll (that is what POLL means...) to see if theres any activity. |
Moderator
|
Well no, removing and monitoring is done in 2 threads, so to avoid problems, things are protected with a mutex. Which can lead to the remove code having to wait until the monitoring code has finished.
Well, unix system calls can be a bit weirdly named, the system call to send a signal to a process is named kill. Not every signal will kill a process. The only real difference between select and poll, is that select places a limit on the number of file descriptors. Anyway I have now committed the code, the monitoring thread has now been split in two threads. One for upload and one for download. The changes should result in faster speeds on LANs and faster internet connections (up to 6 MB/s). |
Registered Member
|
|
Registered Member
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]