I'm writing a server that will copy data from a network interface to multiple sockets. Normally the right way to do this would be to fork a seperate process for each connection request. Unfortunately, only one process can read from the network interface at a time. If I do fork, simultaneous reads will be attempted and I'll dump core. Not a good solution.Pardon? Why not have one reader and multiple writers; the reader and the writers speak to each other over another channel to pass the actual message forward (using message queues, sockets, shared memory, semaphores, filesystems, etc...)?
As far as fork/thread ... I'm partial to forking. But I'm a Unix snob.
In reply to Re: Threads, Forks, or Nothing?
by clintp
in thread Threads, Forks, or Nothing?
by rapier1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |