Protothread

from Wikipedia, the free encyclopedia

In computer science , a protothread is a lightweight mechanism for parallel programming .

In contrast to threads, protothreads manage without their own stack memory . You can map blocking contexts with the least possible memory requirement. Such tasks are often found in computer science, for example when implementing protocols , at interfaces between computers and in embedded systems .

Protothreads is a type of cooperative multitasking . Therefore, context changes can only take place at specially designated program points. Protothreads do not have their own stack memory, so local variables must be defined statically or globally if they are to be retained across a context change.

Protothreads combine the advantages of event-driven (or state machine- controlled) programming with thread-oriented programming. Protothreads were developed and published by Adam Dunkels . Adam Dunkels' implementation is ANSI-C compliant and does not require any machine language. Another implementation uses specific language extensions of the GCC toolchain. Two well-known projects, also published by Adam Dunkels, the TCP / IP stack uIP and the Contiki operating system , use Protothreads.

See also

Individual evidence

  1. Adam Dunkels: Protothreads - Lightweight, Stackless Threads in C ( Memento of the original from October 13, 2005 in the Internet Archive ) Info: The @1@ 2Template: Webachiv / IABot / www.sics.se archive link was automatically inserted and not yet checked. Please check the original and archive link according to the instructions and then remove this notice. .
  2. Larry Ruane: Protothreads
  3. Adam Dunkels: The open source TCP / IP stack for embedded 8-bit microcontrollers ( Memento of the original from April 30, 2010 in the Internet Archive ) Info: The @1@ 2Template: Webachiv / IABot / www.sics.se archive link was automatically inserted and not yet checked. Please check the original and archive link according to the instructions and then remove this notice. .
  4. Adam Dunkels: The Operating System for Embedded Smart Objects - the Internet of Things ( Memento of the original from August 25, 2010 in the Internet Archive ) Info: The @1@ 2Template: Webachiv / IABot / www.sics.se archive link was automatically inserted and not yet checked. Please check the original and archive link according to the instructions and then remove this notice. .

swell