There is a lot malloc/free . very bad code style and use busy loop to waiting for messages ( I'm not refer to the pull form TX server, but the pthread that check for the message queue. ) bad code style lot of void\* , bad code style :( hope you guys will improve