@AlonsoTheBonzo
well i'm not sure if i'm correct but mutex synchronization is the slowes synchronisation method
semaphores are much faster
i tried it with mutex a few days ago and it decreased the speed about 30%
i'm not sure if pipes are that usefull because i have to do a read/write for this too and as far as i know they are not so much faster than simple socket I/O (local!)
so i don't think that pipes reduce the overhead
but maybe if the threads can be correctly balanced with pipes!
if that's true you may be right
@sundialvscs
the only thing i use for this for now is RAM and cpu, my app and the kernel
no hard disk
no NIC
so if i do wrong synchronization it is very likely that i get a big synchronization overhead!
your 500k argument with paging makes sense to me
also your "let-the kernel do the stuff" argument is also good
but i can't do this
because i have 2 sockets (i don't really use the filesystem (if i do i could use sendfile(); but i can't))
and (maybe i only don't know how) the kernel can't do the stuff alone
so i have to do it by myself
i'm not sure what you mean with asynchronous I/O
because i think i do this already
for 2 sockets i have 4 threads
2 reading
2 writing
so i do it asynchron, not?
but i think i know how i can achieve the maximum performance for this
i have to reduce the way data takes from one socket to the other
and i think the only way is a zero-copy algorithm for 2 sockets
sounds like this
http://lwn.net/Articles/152424/
btw: i don't want a solution i want THE solution ;-)
i have a working (good working) solution since 1 week, but i want it faster
as fast as it's possible under the sun