I haven't gotten around to implement this, but @Peter Cordes proposed that I should take a look into the Linux Kernel.
Thanks!