Re: New to network programming a couple questions:
No, that's exactly the sort of place where the problem arises. When trying to push information from one thread to another it is far too easy to end up doing so in a completely unsafe way. It doesn't matter how 'much' is multithreaded - you have multiple threads, and they share data, therefore you're at risk.
1 thread per connection is both wasteful of resources and difficult to program safely with, which is why most people use different approaches.
|