|
|
|
|
|
by cnvogel
4328 days ago
|
|
Probably nothing. {taking aside performance issues when you run into the thousands of parallel connections} I personally prefer the old-school async approach, because there you are forced to explicitly manage your connections' state, and the application/process-wide data access is inherently race-condition free. I'd use this as far as possible. If you let your OS schedule threads, obviously you have to be careful that shared data is correctly locked/only atomically changed, but you get parallelism (especially for CPU heavy tasks) for free. If you are used to do these chores (I'm not), perfect! And your connections state (or the state of required computations) can be arbitrarily complex (ugly?) and still quite elegantly hidden in your threads's stack. So, I don't see that one approach is better than the other. For me the extremes are probably clear in favor of one or the other, with a large grey area in between. |
|