On Thu, Mar 04, 2010 at 11:00:05PM +0300, anonymous wrote: > On Thu, Mar 04, 2010 at 08:14:17PM +0200, Dmitry Maluka wrote: > > Maybe I miss something, but why not just output results as far as hosts > > are scanned? Output isn't that slow to use threads. > > The main idea was abstraction: scanning function just pass scanned host > to next stage instead of calling output function.
What is the profit from this abstraction? You call remove_scanned() which moves host from host queue to scanned queue; output() takes hosts from scanned queue and calls hostprint() for them; and you do synchronization. Why not just call hostprint() at the beginning?