Method and device for processing data transmitted by serial interface

Embodiments of the invention disclose a method and a device for processing data transmitted by a serial interface. The method comprises the following steps: setting a data cache queue having a variable length; when the serial interface receives data to be written in, employing a data input thread to...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: ZHANG SHOUXI, WAN NENG, CHEN XINJIANG
Format: Patent
Sprache:eng
Schlagworte:
Online-Zugang:Volltext bestellen
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Beschreibung
Zusammenfassung:Embodiments of the invention disclose a method and a device for processing data transmitted by a serial interface. The method comprises the following steps: setting a data cache queue having a variable length; when the serial interface receives data to be written in, employing a data input thread to put the data to be written in at the tail of the data cache queue; employing a data output thread to sequentially read out the data from the data cache queue, wherein a mutual exclusion access to the data cache queue is ensured by a cross-thread synchronizing mechanism between the data output thread and the data input thread. The method and the device for processing the data transmitted by the serial interface provided by the embodiments of the invention ensure the mutual exclusion access of the data input thread and the data output thread to the data cache queue, accordingly increasing the reliability of the serial interface data reading process effectively.