Non blocking code in python vs java
Brian MacCallister asks himself for a cool tool that would find places where code can block, and thinks that it would be double cool having mandatory non blocking versions of APIs that typically block (say JDBC drivers). He wants something like twisted for java (Grizzly and Apache Mina seem to be the closest to it).
I think the answer lies in the chronic unability of python to deal with threads. While I like python a lot, the GIL puts it in a very bad situation for threaded programming. I’m not sure this is a bad thing, as blindly throwing threads to problems is an engineering technique that has plagued java for years and impedes it to scale in a world where thousands of microthreads are needed for small scale interactions such as AJAX
Another area where a solution to blocking behavior is needed is DNS lookup. I don’t think there is yet a standard way to deal with it, and getting it rightly integrated in an asynchronous processing loop for gajim is driving me nuts.
On the other hand, I am currently dealing myself with a maintenance problem that arises, precisely, from the fact that the MySQL driver that takes care of CDR records for Asterisk blocks, and the whole asterisk is prone to fail because of the coupling. I might have to write some bridging code to make this process asynchronous, so I understand Brian well... maybe too well. :(