Operating Systems Assignment - Multi-threading and memory management in C