T
Tom Forsmo
I am experimenting with a high performance UDP server for both stateless
and stateful UDP operations and a problem occurs to me when dealing with
threads. Does DatagramSocket for sending a packet require me to
explicitly use a synchronised wrapper method, or will the java/kernel
socket implementation perform that task for me automatically?
(When it comes to the kernel I know it depends on the kernel, but as far
as I know, in Linux for example, kernel operations are single threaded.
This does not stop the newer versions of having very finegrained
interruptible kernel code (low latency patch), but this is a different
matter.)
I am worried that if I were to synchronise operations myself, it might
affect performance more than necessary. Perhaps because kernel
synchronisation is faster than java synchronisation, if that is the
case. Or that there are two levels of synchronisation, when only one is
needed, which then leads to wasted time.
Any thoughts?
tom
and stateful UDP operations and a problem occurs to me when dealing with
threads. Does DatagramSocket for sending a packet require me to
explicitly use a synchronised wrapper method, or will the java/kernel
socket implementation perform that task for me automatically?
(When it comes to the kernel I know it depends on the kernel, but as far
as I know, in Linux for example, kernel operations are single threaded.
This does not stop the newer versions of having very finegrained
interruptible kernel code (low latency patch), but this is a different
matter.)
I am worried that if I were to synchronise operations myself, it might
affect performance more than necessary. Perhaps because kernel
synchronisation is faster than java synchronisation, if that is the
case. Or that there are two levels of synchronisation, when only one is
needed, which then leads to wasted time.
Any thoughts?
tom