The last possibility is particularly troublesome because there are so many ways in which you can crash your system if you have concurrent processes. What if you call memchr to search a block of memory that you have allocated and it garbles one of your memory manager's data structures? If a concurrent process-a code thread or an interrupt routine, say- then switches into context, it had better not invoke the memory manager because the system may crash. What if you call memchr to scan a global array and it steps on an adjacent variable used by another task? Or what if two instances of your program try to search shared data in parallel? Any number of scenarios can kill your program.
-- Steve Maguire, Writing Solid Code