TAILIEUCHUNG - Protothreads: Simplifying Event-Driven Programming of Memory-Constrained Embedded Systems

Event-driven programming is a popular model for writing programs for tiny embedded systems and sensor network nodes. While event-driven programming can keep the memory overhead down, it enforces a state machine programming style which makes many programs dif cult to write, maintain, and debug. We present a novel programming abstraction called protothreads that makes it possible to write eventdriven programs in a thread-like style, with a memory overhead of only two bytes per protothread. We show that protothreads signi cantly reduce the complexity of a number of widely used programs previously written with event-driven state machines. For the examined programs the majority of the state machines could be entirely removed. In the other cases the. | Protothreads Simplifying Event-Driven Programming of Memory-Constrained Embedded Systems Adam Dunkels Oliver Schmidt Thiemo Voigt Muneeb All í Swedish Institute of Computer Science Box 1263 SE-16429 Kista Sweden TU Delft Mekelweg 4 2628 CD Delft The Netherlands adam@ oliver@ thiemo@ Abstract Event-driven programming is a popular model for writing programs for tiny embedded systems and sensor network nodes. While event-driven programming can keep the memory overhead down it enforces a state machine programming style which makes many programs difficult to write maintain and debug. We present a novel programming abstraction called protothreads that makes it possible to write event-driven programs in a thread-like style with a memory overhead of only two bytes per protothread. We show that protothreads significantly reduce the complexity of a number of widely used programs previously written with event-driven state machines. For the examined programs the majority of the state machines could be entirely removed. In the other cases the number of states and transitions was drastically decreased. With protothreads the number of lines of code was reduced by one third. The execution time overhead of protothreads is on the order of a few processor cycles. Categories and Subject Descriptors Programming Techniques Concurrent Programming General Terms Design Experimentation Measurement Performance Keywords Wireless sensor networks Embedded systems Threads 1 Introduction Event-driven programming is a common programming model for memory-constrained embedded systems including sensor networks. Compared to multi-threaded systems event-driven systems do not need to allocate memory for perthread stacks which leads to lower memory requirements. For this reason many operating systems for sensor networks Work done at the Swedish Institute of Computer Science. Permission to make digital or hard copies of all or part of this work for .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.