The increasing significance of operating systems (OSs) in the development of the internet of things (IoT) has emerged in the last decade. An event-driven OS is memory efficient and suitable for resource-constrained IoT devices and wireless sensors, although the program’s control flow, which is determined by events, is not always obvious. A multithreaded OS with sequential control flow is often considered clearer. However, this approach is memory-consuming. A hybrid OS seeks to combine the strengths of the event-driven approach with multithreaded approach. An event-driven cooperative threaded OS represents a hybrid approach that supports concurrency by explicitly yielding control to another thread. Although this approach is memory efficient, as cooperative threads are not preemptive, it may not provide sufficient real-time performance. This article proposes a memory-efficient hybrid OS, called StateOS, for resource-constrained IoT devices. It is an event-driven cooperative threaded OS with partial real-time performance. StateOS implements a hybrid task scheduler that combines two cooperative threaded subsystems as kernel processes on a priority-based preemptive scheduler. This approach provides adequate real-time performance for IoT devices at a low memory cost.