So, I have to make approximate 800 system calls that each retreive a word from a sort of database. I'm trying to convert this over from a csh script that retreives each word in a loop (it's actually 800 words spread over 90 lines, so there's a loop for the 90 lines and a nested loop for each word on the line) and then echoes each word to the screen as it gets it. This takes 12 seconds (or so) since it is executing all 800 calls in serial.
What I would like to do is make all 800 calls at once (or something reasonable like maybe all 90 lines at once, each fetching their own words) and then display all the words in the correct order. Because I'm new at this kind of processing, the only solution I could come up with is to have each forked call write to a file and then concatenate the files after a short time when I can assume they had all finished. There must be a better way.
So, I figure I'm forking some children here, but not sure of the best way to store the info so it's all in order at then end of the day.
Any hints?
Xhonzi
What I would like to do is make all 800 calls at once (or something reasonable like maybe all 90 lines at once, each fetching their own words) and then display all the words in the correct order. Because I'm new at this kind of processing, the only solution I could come up with is to have each forked call write to a file and then concatenate the files after a short time when I can assume they had all finished. There must be a better way.
So, I figure I'm forking some children here, but not sure of the best way to store the info so it's all in order at then end of the day.
Any hints?
Xhonzi