Functions to allow coop-multitasking with binaries