On Paul Tyma’s presentation, I found an interview question:
What’s harder, synchronizing 2 threads or synchronizing 1000 threads?
From my perspective, of course synchronizing 1000 threads is harder, but I can’t think of a good reasons for that beside ‘of course’. But since it’s interview question, may be I’m wrong (interview questions have to be tricky, isn’t it?).
Synchronizing a thousand threads is just as easy as synchronizing two threads: just lock access to all important data.
Now, synchronizing a thousand threads with good performance is more difficult. If I were asking this question, I’d look for answers mentioning “the thundering herd problem”, “lock contention”, “lock implementation scalability”, “avoiding spinlocks”, etc.