Recently, someone asked me why he can't allocated enough memory with a lot of thread functions. At first, I just tried to explain that there is no problem in Linux kernel or malloc() functions. But, when double checked his code, I found that he used malloc() without any safeguard. Yeah, no synchronization around malloc(). Sigh.… Continue reading Are malloc() and free() functions thread-safe?