Multithreading Using Arduino Due

I am wondering why there is not example of multithreading in arduino Due . It has Arm cortex M3 microcontroller .
Can anyone know how to use multithreading with arduino due . I am 300% sure that multithreading is possible with
the microcontroller used in arduino Due . I worked with pic,msp430 series , 8051,avr and Arduino boards . I also used
STM discovery kits(ARM) with keil . it supports multithreading but it is very difficult to start with keil arm mdk's version where as
arduino due is very easy to use. but the real benifit of arduino due will come when you will be doing concurrant processing many task at the same time ....... :D.
but the question is How ????? any body can guide us ...

have you taken a look at this:

:slight_smile: there has even been a port of it to support AVR devices as well

it has come in useful for some of my own projects, it was originally designed for ARM (Due) - but it should give you some basic implementation that could be useful for you. the other option is to use a state machine (search forum for ideas) and simulate multi-threading yourself.

The FreeRTOS package can be melded with the Arduino environment, albeit with
substantial changes to how things are coded. FreeRTOS is a pre-emptive multitasking
framework for ARM Cortex machines (probably others too).

I came across it with on the EMFcamp 2014 badge (an Arduino Due compatible
board with display and various sensors). The developers created open-source
extensions to Arduino environment to handle it compiling with or without the RTOS

Pre-emptive multitasking means the user application code can no-longer handle interrupts
or other global resources directly, its closer to a full OS.

@@@@ ardiri thanx you made my day ..