WordCount performance
Walter Bright
newshound1 at digitalmars.com
Thu Mar 27 14:16:28 PDT 2008
Georg Wrede wrote:
> Hmm. What kind of situations would need multiple threads simultaneously
> reading from stdin? And if there aren't any, wouldn't locking be like
> wearing a life vest on land?
If it was unsynchronized, if you had two threads reading lines from the
input, the contents of the lines would be interleaved. With syncing,
each thread will get complete lines.
> And isspace, is that really the right place to check for ascii?
It has to be, because its argument is an int, not a char.
More information about the Digitalmars-d
mailing list