author | Florian Forster <octo@huhu.verplant.org> | |
Sat, 17 Jan 2009 10:19:08 +0000 (11:19 +0100) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Sat, 17 Jan 2009 10:19:08 +0000 (11:19 +0100) | ||
commit | 0b6de87f3d08326ee3200db8e16f3738df027ac0 | |
tree | 0488cef0bf79be961255e222fe29bca6d3454ef3 | tree | snapshot |
parent | 6667ac0ae4b48596df71998d38ef945b984102d3 | commit | diff |
network plugin: Make the receive thread even faster.
On very busy systems, the thread apparently may not be scheduled often enough.
So the receive buffer fills up quickly and data may be lost.
This patch changes the `mutex_lock' to a `mutex_trylock' and data is only
appended to the global receive-queue if the lock can be obtained without
blocking.
If the lock cannot be obtained without blocking, the data is instead appended
to a private queue and that queue is appended to the global queue when the lock
can next be taken.
On very busy systems, the thread apparently may not be scheduled often enough.
So the receive buffer fills up quickly and data may be lost.
This patch changes the `mutex_lock' to a `mutex_trylock' and data is only
appended to the global receive-queue if the lock can be obtained without
blocking.
If the lock cannot be obtained without blocking, the data is instead appended
to a private queue and that queue is appended to the global queue when the lock
can next be taken.
src/network.c | diff | blob | history |