Re:Why not C++?
by jcoffland on Saturday March 05, 2016 @03:40PM
(#11230990)
You may be right that a lot of software has some CPU bounds parts but I would argue that most code is IO bound. Usually there is a only a small kernel in a program that actually does heavy computation and this is the only place you should use threading.
[ Parent
| on HN ]
Re:Why not C++?
by Coding_Cat on Saturday March 05, 2016 @05:42PM
(#11231439)
What's wrong with threading on IO? For example if you have a webserver which has to wait on replies from various other resources while serving enough clients to saturate itself.
Sure, performance wise it is probably better to have a fixed number of threads which do their own scheduling in userspace but this requires much more work then a simple if(!finished()){yield();} and making a thread per client.
Re:Why not C++?
by jacques_chester on Saturday March 05, 2016 @05:56PM
(#11231498)
> What's wrong with threading on IO?
To modify JWZ's famous joke:
You have a problem. You say, "I know, I'll use threads!"
Nowyou prob h2ave lems