Before I discovered Python I wrote an event driven server in C (using libevent). At first it was mainly I/O bound so it worked out great. Then came along some CPU intensive tasks, so I spin off a few threads. They are pretty localized so my only locks are for passing events in and out of the threads.
Now I'm looking at doing more work with Python. Whats the ideal mix of Python and C. I'm looking at using Python modules to extend my C app.
Obviously the other way is to use Python and extend in C. If my C exensions are working in threads how will this affect Python and the GIL?
I'd probably keep all I/O event based and in the main thread and just use worker threads to do the long running tasks.
So now I have to decide, C as the main loop or Python/Twisted.