http://qs1969.pair.com?node_id=381229


in reply to Re: Unexpected output from fork (Win32)
in thread Unexpected output from fork (Win32)

As your lines are 16 bytes, and each kid is processing 256 lines per buffer load, that makes the buffer size 4096 bytes. Notionally, the first thread to run will process lines 1..256 then 2561..2817 then 5121..5377 etc.

How blindingly obvious :-) Thanks.

This was only a test program - I put the sleep statement in because the first thread processed all 10_000 without it and the operations that will eventually be in there will certainly take several seconds to complete.

Once again thanks for a crystal clear explanation! It all makes sense now.

- Mark