For example, TinyThread [14], TOSThreads [15] are thread libraries based on TinyOS; Contiki supports preemptive multi-threading via a library on top of the event-driven kernel [5], and it also implements a lightweight threading mechanism called protothreads [16]. LiteOS has a multi-threaded kernel to run applications as threads concurrently [10].