what is a multiplexing server?
-
hiho i read a book about linux networking and it describes some techniques for a server but my question is more about software architecture than linux programming so i post it here 1. multiplexing (select()) 2. multiprocess (fork()) 3. multithreaded (pthread's) i understand the architecture of a process pool in which every process holds a thread pool where every thread calls accept on a socket to get the connection the kernel then makes the decision which thread gets the connection and that's why i don't understand multiplexing because i think multiplexing does exactly the same you use select to wait for a connection (or a descriptor to change its state) and then make accept but if this can the kernel do for you what is a multiprocessed, multithreaded multiplexing server good for? or what exactly is a multiplexing server compared with a multiprocesses/multithreaded server? thx@ll
-
hiho i read a book about linux networking and it describes some techniques for a server but my question is more about software architecture than linux programming so i post it here 1. multiplexing (select()) 2. multiprocess (fork()) 3. multithreaded (pthread's) i understand the architecture of a process pool in which every process holds a thread pool where every thread calls accept on a socket to get the connection the kernel then makes the decision which thread gets the connection and that's why i don't understand multiplexing because i think multiplexing does exactly the same you use select to wait for a connection (or a descriptor to change its state) and then make accept but if this can the kernel do for you what is a multiprocessed, multithreaded multiplexing server good for? or what exactly is a multiplexing server compared with a multiprocesses/multithreaded server? thx@ll
Multiplexing is easy. It is a technique to handle multiple sockets with only one thread. You use a loop with a call to select to detect action on every single socket to be able to answer requests for example! This needs less resources than multi-threading or even forking. Don't try it, just do it! ;-)
-
Multiplexing is easy. It is a technique to handle multiple sockets with only one thread. You use a loop with a call to select to detect action on every single socket to be able to answer requests for example! This needs less resources than multi-threading or even forking. Don't try it, just do it! ;-)
but i don't need multiple sockets! i just need to listen on one socket! does it make sense if i only need to listen on one socket?