FreeRTOS+POSIX is still in the lab
FreeRTOS+POSIX is provided under the MIT open source license by Amazon Web Services.
We encourage you to give FreeRTOS+POSIX a try, but please be aware when doing so that the code is still in the lab, which means we have not yet completed our review and test quality control processes. Please use the forum for support, or contact us directly if you have a specific business interest.
FreeRTOS+POSIX Pre-configured Example[FreeRTOS+POSIX Overview]
OverviewThe pre-configured example documented on this page uses the FreeRTOS Windows port. It demonstrates how FreeRTOS+POSIX can be used to port a simple POSIX threading compliant application (in this case, an implementation of the actor model) to the FreeRTOS kernel. To demonstrate the concept, the application is built for execution on both Linux (which uses POSIX threads) and FreeRTOS.
On this page:
This demo creates two types of actors: dispatcher and workers. Dispatchers tell workers what to do by sending different types of messages to the works. Each time a worker receives a message it performs a predefined routine that is dependent on the message it received. At the end of the demo the dispatcher notifies the workers that there is nothing more to do and all actors (dispatcher and worker) terminate.
Each actor is a thread that is created using the POSIX pthread_create() function. Messaging is performed through queues using the POSIX mq_open(), mq_send(), mq_timedsend() and mq_receive() functions.
Note that FreeRTOS cannot return from main() without ending the entire application, so the native FreeRTOS API is used to create a task called vStartPOSIXDemo(), which then used to run the same actor demo as already demonstrated running on Linux.