Protothreads | Protothreads from http : //dunkels.com/adam/pt/

 by   shixiongfei C Version: Current License: No License

kandi X-RAY | Protothreads Summary

kandi X-RAY | Protothreads Summary

Protothreads is a C library. Protothreads has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

Protothreads are extremely lightweight stackless threads designed for severely memory constrained systems such as small embedded systems or sensor network nodes. Protothreads can be used with or without an underlying operating system. Protothreads provides a blocking context on top of an event-driven system, without the overhead of per-thread stacks. The purpose of protothreads is to implement sequential flow of control without complex state machines or full multi-threading. The protothreads library is released under an open source BSD-style license that allows for both non-commercial and commercial usage. The only requirement is that credit is given. The protothreads library was written by Adam Dunkels adam@sics.se with support from Oliver Schmidt ol.sc@web.de. More information and new versions can be found at the protothreads homepage: Documentation can be found in the doc/ subdirectory.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              Protothreads has a low active ecosystem.
              It has 6 star(s) with 5 fork(s). There are 2 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              Protothreads has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of Protothreads is current.

            kandi-Quality Quality

              Protothreads has no bugs reported.

            kandi-Security Security

              Protothreads has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              Protothreads does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              Protothreads releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Protothreads
            Get all kandi verified functions for this library.

            Protothreads Key Features

            No Key Features are available at this moment for Protothreads.

            Protothreads Examples and Code Snippets

            No Code Snippets are available at this moment for Protothreads.

            Community Discussions

            QUESTION

            Mutual exclusion within a function Contiki
            Asked 2019-Sep-24 at 19:39

            Because the in built list provided by Contiki doesn't fit my needs (uses too much memory) I have implemented my own list version that has been optimized for how I intend to use it.

            At any one time there will be a single one of these lists that will be operated on (i.e. add/remove elements) by multiple processes/protothreads. However, additions/removals do not occur within a process/protothread block, but instead are called within a function that is called through a series of function calls initiated by a process/protothread.

            For example,

            ...

            ANSWER

            Answered 2018-May-29 at 12:18

            You seem to be confused about what protothreads do. The protothread approach is a form of cooperative scheduling. A protothread can only yield at specific points, when asked to yield by the execution flow. An interrupt can never switch the execution flow to another protothread.

            So, there are two distinct options:

            1) If your list is accessed both from protothread and from interrupt handler contexts, you need to do all modifications in the list with interrupts disabled. So your lock/unlock code is disable/enable interrupts, respectively.

            2) If your list is only accessed from protothreads, you don't need any locking. This is the recommended design.

            Indeed, the main advantage of using protothreads is that in 99% of cases locks are not needed.

            Source https://stackoverflow.com/questions/50559566

            QUESTION

            Understanding Macro behavior and protothreads
            Asked 2018-May-22 at 14:10

            Thanks in advance for the help.

            First a preface. I have been looking at using the Contiki TSCH implementation given at https://github.com/contiki-os/contiki/tree/master/core/net/mac/tsch. While running a simple example in the Cooja simulator (with a few log messages that I have added to the base code so I can see what's going on) I noticed that the ASN counter was not incrementing its most significant byte.

            Specifically, the ASN (absolute slot number for TSCH) is given by the struct

            ...

            ANSWER

            Answered 2018-May-22 at 14:10

            It looks like mismatch between printf specifiers and actual argument types happening on 16-bit architecture. It is recommended to use specifiers defined as format macro constants in inttypes.h for all integer types coming from stdint.h

            I.e. when x is of type uint32_t you shall use

            Source https://stackoverflow.com/questions/50440574

            QUESTION

            Time slice function without a OS scheduler
            Asked 2017-Feb-14 at 13:53

            I have a part of a library that processes data and takes quite a long time. In some cases it's not possible to wait for the results of the function but there are other tasks that should be done. On a system with an OS that's not a problem, as the scheduler can help with that. But there are also systems that have no OS available. On these systems I want to achieve something similiar, i.e. the function is called does some calculations and returns after a given period (say 10ms). Then the other things are done and the data processing function gets called again and takes off at the position it left.

            ...

            ANSWER

            Answered 2017-Feb-14 at 13:06

            As long as other_stuff is reasonably short, you can do it in a timer ISR.

            In case you don't want to use the task context savings of an (RT)OS, you have to implement them on your own - break your long-running processing function down into pieces, save the processing context and return to your main dispatching point. After the next step is done, come back to the saved context and re-start processing where you left off. (This is more or less what protothreads do)

            The end consequence is that once you're done, you might have implemented most of the parts of a multitasking time-slicing OS.

            Source https://stackoverflow.com/questions/42226347

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install Protothreads

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/shixiongfei/Protothreads.git

          • CLI

            gh repo clone shixiongfei/Protothreads

          • sshUrl

            git@github.com:shixiongfei/Protothreads.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link