I took it upon myself recently to work towards making a general-purpose Translator to automatically translate js programs into C, but I got stuck when thinking of asynchronous behaviour. Using ANSI / POSIX C, and only allowing yourself to use a library for a threadpool implementation, how would you go about implementing asynchronous function calls in C. The methodology must be thread-safe. When I came up with my approach, I was inspired by this source's use of what they call the Asynchronous Dispatcher pattern: https://doanduyhai.wordpress.com/2012/08/04/design-pattern-the-asynchronous-dispatcher/