I am investigating ways of making my bundle of python network-requesting processes more efficient and became interested in the likes of Go and Julia for their apparent strong concurrency support and green threading model.As I read into user level threads it sounded like what I was actually interested in was kernel level threading to take full advantage of multicore architecture and reduce context switching penalties. But I have now read conflicting information on which threading model implies greater context switching penalties.To be clear, currently I have about 18 python 2.7 processes waking up and doing mainly network-bound processing on a dual core box. This seems heavy to me so I am looking at languages which support efficient threading. I guess context switching is something that only applies in the case of multiple processes (or maybe applies to shared memory threads too? Not sure) so what would be the most efficient threading type for one 'superprocess' per CPU which spawn lots of long-lived (essentially a pool of) little network bound threads on startup?
languages with native thread support
python;multithreading;concurrency;go
It's not really relevant if the programming language has builtin multithreading support or not but whether it can create kernel threads or not. Many languages can by using various libraries rather than having builtin support. In Python, threads are kernel threads but you cannot execute instructions concurrently. However, other threads can run if one of them is blocked waiting for an I/O operation. Which is helpful for I/O bound activities (as yours), but not for CPU bound activities.Whenever you use threads or processes you have to do context switches. The thread context switch is more efficient than the process context switch since you don't have to change the memory space.Thus, a Python threads are a good solution to your problem, considering the I/O bound operations. 