1. An embedded system, comprising: a processing unit, simultaneously executing at least one first thread having a flag for performing a data acquisition operation and one second thread for performing a data process and output operation for acquired data in the data acquisition operation, wherein the flag is used for indicating that a state of the first thread is in one of an execution state and a sleep state; and a memory coupled to the processing unit, providing a shared buffer for the at least one first thread and the second thread, wherein, the processing unit checks the flag before executing the second thread, wherein the second thread is executed when the flag indicates the sleep state while execution of the second thread is suspended when the flag indicates the execution state.