The problem is that initializing a writer takes a non zero amount of time. During this period we can't read any cells off the interface and at OC3 and OC12 speeds (which is what we are dealing with) it can be a significant bit of data lost. So the ideal solution would be to off load the writer initialization and handling to another thread so that existing writers wouldn't have the data flow interrupted.in pseudo code while (1) if accept (non blocking) initialize writer add Ptr to writer hash if %writer read_cell (atm cells) foreach connection %writer if lifetime of writer exceeded undef $writer{connection} next write cell and then back through the loop.
The goal is to have a server that can gracefully handle gigabit speeds and more than 5 writers at a time.
Also, as I stated, I do not think forking can work. I can only have one reader on an interface at a time. If there is some way to only fork a subroutine I'm all ears (eyes, whatever).
In reply to Re: Re: Threads, Forks, or Nothing?
by rapier1
in thread Threads, Forks, or Nothing?
by rapier1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |