Protothread (original) (raw)

About DBpedia

Protothreads是一种低开销的并发编程机制。Protothreads充当无栈的轻量级线程或协程,它使用了极小的每protothread内存:一个短整数保存执行位置,一个字节作为让步标志。

Property Value
dbo:abstract In der Informatik ist ein Protothread ein leichtgewichtiger Mechanismus zur parallelen Programmierung. Protothreads kommen im Gegensatz zu Threads ohne eigenen Stapelspeicher aus. Sie können blockierende Kontexte mit geringstmöglichem Speicherbedarf abbilden. Solche Aufgabenstellungen findet man in der Informatik häufig, zum Beispiel beim Umsetzen von Protokollen, bei Schnittstellen zwischen Computern und in eingebetteten Systemen. Protothreads ist eine Art des kooperativen Multitasking. Deshalb können Kontextwechsel nur an speziell vorgesehenen Programmstellen stattfinden. Protothreads haben keinen eigenen Stapelspeicher, deshalb müssen lokale Variable statisch oder global definiert werden, wenn sie über einen Kontextwechsel hinweg erhalten bleiben sollen. Protothreads verbinden die Vorteile von ereignisgetriebener (bzw. durch Zustandsautomaten gesteuerter) Programmierung mit threadorientierter Programmierung. Protothreads wurden von entwickelt und veröffentlicht. Die Umsetzung von Adam Dunkels ist ANSI-C-konform und kommt ohne Maschinensprache aus. Eine weitere Umsetzung nutzt spezifische Spracherweiterungen der GCC-Toolchain. Zwei bekannte, ebenfalls von Adam Dunkels veröffentlichte Projekte, der TCP/IP-Stack uIP und das Betriebssystem Contiki, nutzen Protothreads. (de) A protothread is a low-overhead mechanism for concurrent programming. Protothreads function as stackless, lightweight threads, or coroutines, providing a blocking context cheaply using minimal memory per protothread (on the order of single bytes). Protothreads are used to accomplish a non-preempted form of concurrency known as cooperative multitasking and, therefore, do not incur context switch when yielding to another thread. Within a protothread, yielding is accomplished by utilizing Duff's device within a thread's function and an external variable used in within the switch statement. This allows jumping (resuming) from a yield upon another function call. In order to block threads, these yields may be guarded by a conditional so that successive calls to the same function will yield unless the guard conditional is true. A feature of protothreads relative to other implementations of coroutines, or proper threads, is that they are stackless. This has advantages and disadvantages. A disadvantage is that local variables within the protothread cannot be trusted to have retained their values across a yield to another context. They must retain their state through the use of static or external, often global, variables. An advantage is that they are very lightweight and therefore useful on severely memory constrained systems like small microcontrollers where other solutions are impractical or less desirable. Tom Duff, of Duff's device fame, had this to say about the shortcomings of the method: "a similar trick for interrupt-driven state machines that is too horrible to go into. [...] I never thought it was an adequate general-purpose coroutine implementation because it’s not easy to have multiple simultaneous activations of a coroutine and it’s not possible using this method to have coroutines give up control anywhere but in their top-level routine. A simple assembly-language stack-switching library lets you do both of those." The protothread concept was developed by Adam Dunkels and Oliver Schmidt, based on prior work by Simon Tatham and Tom Duff. (en) Протопоток — единица программной обработки, обеспечиваемая особыми программными средствами, позволяющими не задействовать механизмы потоков операционной системы, одна из форм реализации сопрограмм. Работая как «легковесные» потоки, не использующие стек, протопотоки обеспечивают блокирующий контекст ценой расхода считанных байтов памяти на один поток. Из-за того, что протопотоки не используют стек, приходится использовать глобальные переменные для сохранения значений при переключении контекста.Протопотоки невытесняемы, поэтому переключение контекста возможно только на блокирующих операциях. Концепцию протопотоков разработали и . Реализовано несколько различных библиотек протопотоков для Си и C++. (ru) Protothreads是一种低开销的并发编程机制。Protothreads充当无栈的轻量级线程或协程,它使用了极小的每protothread内存:一个短整数保存执行位置,一个字节作为让步标志。 (zh)
dbo:wikiPageExternalLink https://web.archive.org/web/20140604192611/http:/www.manishshakya.com.np/index.php/page/code http://dunkels.com/adam/pt/ http://dunkels.com/adam/dunkels05using.pdf https://web.archive.org/web/20100725045509/http:/eigenclass.org/hiki/threadring-with-protothreads https://web.archive.org/web/20160419190507/http:/www.mind-flip.com/theBlog/2007/12/12/protothreads-removing-the-state-from-state-machine/ http://code.google.com/p/protothread/
dbo:wikiPageID 2853187 (xsd:integer)
dbo:wikiPageLength 4500 (xsd:nonNegativeInteger)
dbo:wikiPageRevisionID 1056515489 (xsd:integer)
dbo:wikiPageWikiLink dbr:Preemption_(computing) dbr:Monitor_(synchronization) dbc:Threads_(computing) dbr:Duff's_device dbr:Conditional_(computer_programming) dbr:Contiki dbr:Coroutines dbr:GNU_Compiler_Collection dbr:Concurrency_(computer_science) dbr:Concurrent_programming dbr:Context_switch dbr:Cooperative_multitasking dbr:Coroutine dbr:Call_stack dbr:Simon_Tatham dbr:Microthread dbr:Tom_Duff dbr:Adam_Dunkels dbr:POSIX_Threads dbr:Global_variable dbr:Blocking_(computing) dbr:Scheduling_(computing) dbr:Switch_statement dbr:UNIX_kernel dbr:Thread_(computer_science)
dbp:wikiPageUsesTemplate dbt:Reflist dbt:Compu-prog-stub
dcterms:subject dbc:Threads_(computing)
rdfs:comment Protothreads是一种低开销的并发编程机制。Protothreads充当无栈的轻量级线程或协程,它使用了极小的每protothread内存:一个短整数保存执行位置,一个字节作为让步标志。 (zh) In der Informatik ist ein Protothread ein leichtgewichtiger Mechanismus zur parallelen Programmierung. Protothreads kommen im Gegensatz zu Threads ohne eigenen Stapelspeicher aus. Sie können blockierende Kontexte mit geringstmöglichem Speicherbedarf abbilden. Solche Aufgabenstellungen findet man in der Informatik häufig, zum Beispiel beim Umsetzen von Protokollen, bei Schnittstellen zwischen Computern und in eingebetteten Systemen. (de) A protothread is a low-overhead mechanism for concurrent programming. Protothreads function as stackless, lightweight threads, or coroutines, providing a blocking context cheaply using minimal memory per protothread (on the order of single bytes). The protothread concept was developed by Adam Dunkels and Oliver Schmidt, based on prior work by Simon Tatham and Tom Duff. (en) Протопоток — единица программной обработки, обеспечиваемая особыми программными средствами, позволяющими не задействовать механизмы потоков операционной системы, одна из форм реализации сопрограмм. Работая как «легковесные» потоки, не использующие стек, протопотоки обеспечивают блокирующий контекст ценой расхода считанных байтов памяти на один поток. Из-за того, что протопотоки не используют стек, приходится использовать глобальные переменные для сохранения значений при переключении контекста.Протопотоки невытесняемы, поэтому переключение контекста возможно только на блокирующих операциях. (ru)
rdfs:label Protothread (de) Protothread (en) Протопоток (ru) Protothreads (zh)
owl:sameAs wikidata:Protothread dbpedia-de:Protothread dbpedia-ru:Protothread dbpedia-zh:Protothread https://global.dbpedia.org/id/21Jvk
prov:wasDerivedFrom wikipedia-en:Protothread?oldid=1056515489&ns=0
foaf:isPrimaryTopicOf wikipedia-en:Protothread
is dbo:knownFor of dbr:Adam_Dunkels dbr:Muneeb_Ali
is dbo:wikiPageRedirects of dbr:Protothreads
is dbo:wikiPageWikiLink of dbr:List_of_computer_scientists dbr:List_of_programmers dbr:PowWow dbr:Coroutine dbr:Microthread dbr:Adam_Dunkels dbr:List_of_Internet_entrepreneurs dbr:Protothreads dbr:Muneeb_Ali
is dbp:knownFor of dbr:Muneeb_Ali
is foaf:primaryTopic of wikipedia-en:Protothread