convert stuff to libevent instead of threads
No threads means no locks