Home Articles News distortos is one year old!
distortos is one year old!
User Rating: / 0
PoorBest 
Written by Freddie Chopin   
Thursday, 23 July 2015 22:11

One year and one day passed since I started writing my own RTOS. distortos project is still evolving and - as of today - has 1542 commits. Since previous news article only two new features were implemented, but both of them are rarely seen in other RTOSes. One of them is OnceFlag class with callOnce() function - which are equivalents of std::once_flag class and std::call_once() function from C++11 standard or pthread_once_t structure and pthread_once() function from <pthread.h>.

Second new feature is an implementation of POSIX signals. Signals can be handled both by synchronous waiting - with ThisThread::Signals::wait(), ThisThread::Signals::tryWait(), ThisThread::Signals::tryWaitFor() andThisThread::Signals::tryWaitUntil() functions - and by asynchronous signal handlers - using ThisThread::Signals::setSignalAction() function. As in the established standards, delivery of signal causes interruption of some blocking functions (like Semaphore::wait() or MessageQueue::pop()), which return EINTR error code in that case. Looking at this feature from the other side - from the "source" of the signal - it is possible to "generate" the signal (ThreadBase::generateSignal()) or "queue" the signal with a value (ThreadBase::queueSignal()). Obviously, the signals can also be masked and ignored.

All of that is - still - possible without a single byte of dynamically allocated memory! In case of static threads (StaticThread instances) it is necessary to state whether the thread can receive the signals at all, how many signals can be queued simultaneously and how many different SignalAction objects can be used at the same time.

Stay tuned!

██╗  ██╗ █████╗ ██████╗ ██████╗ ██╗   ██╗
██║  ██║██╔══██╗██╔══██╗██╔══██╗╚██╗ ██╔╝
███████║███████║██████╔╝██████╔╝ ╚████╔╝ 
██╔══██║██╔══██║██╔═══╝ ██╔═══╝   ╚██╔╝  
██║  ██║██║  ██║██║     ██║        ██║   
╚═╝  ╚═╝╚═╝  ╚═╝╚═╝     ╚═╝        ╚═╝   

██████╗ ██╗██████╗ ████████╗██╗  ██╗██████╗  █████╗ ██╗   ██╗
██╔══██╗██║██╔══██╗╚══██╔══╝██║  ██║██╔══██╗██╔══██╗╚██╗ ██╔╝
██████╔╝██║██████╔╝   ██║   ███████║██║  ██║███████║ ╚████╔╝ 
██╔══██╗██║██╔══██╗   ██║   ██╔══██║██║  ██║██╔══██║  ╚██╔╝  
██████╔╝██║██║  ██║   ██║   ██║  ██║██████╔╝██║  ██║   ██║   
╚═════╝ ╚═╝╚═╝  ╚═╝   ╚═╝   ╚═╝  ╚═╝╚═════╝ ╚═╝  ╚═╝   ╚═╝   

MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM::MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM::MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:::MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:::::MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM::::::MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM::::::MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM::::::::MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM::::::::MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:::::~~:MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:::~?~:MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM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$$$$$$$$$ZZZZZ8OZZZZZZZZZZZZZZZZZZZZZZZZZ88888888888888MMMMMMM
MMMMMMOZZZ88OZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ888888888888NMMMMMMM
MMMMMNOZZZZZZZZZZZZZZZZZZZZZZZZO888ZZZZ88888ZZZZZZZZZZZ88888888888888888MMMMMMMM
MMMMM8OOZZZZZZZZZZZZZZZZZZZZO88888ZZZZZ888888ZZZZZZZZZZ88888888888888888MMMMMMMM
MMMMM8OOOZZZZZZZZZZZZZZZZZZZ88888ZZZZZZZZZZZZZZZZZZZZZZZ88OO888888888888MMMMMMMM
MMMMMMOOZZZZZ88ZZZZZZZZZZZZZZ88ZZZZZZZZZZZZZZZZZZZZZZZZZO8O8888888888888MMMMMMMM
MMMMMMOOZZZZ88888ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ888888888888888MMMMMMMM
MMMMMMMOOOZZ8888OZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ8888888888888888MMMMMMMM
MMMMMMMMMMNOOOOOZZZZZZZZZ8ZZZZZZZZZZZZZZZZZZZZZZZZZ8888O8888888888888NMMMMMMMMMM
MMMMMMMMMMMMN8OOOOOZZZZZZZZZZZZZZZZZZO88ZZZZZZZZZZO8888888888888888DMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMM888ZZZZZZZZZZZZZZZZ88ZZZZZZZZZZZZZO8888888888888MMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMN8ZZZZZZZZZZZZZZZZZZZZZZZZZOOO88888888888MMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNOZZZZZZZZZZO888888888888MMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM

██████╗ ██╗███████╗████████╗ ██████╗ ██████╗ ████████╗ ██████╗ ███████╗
██╔══██╗██║██╔════╝╚══██╔══╝██╔═══██╗██╔══██╗╚══██╔══╝██╔═══██╗██╔════╝
██║  ██║██║███████╗   ██║   ██║   ██║██████╔╝   ██║   ██║   ██║███████╗
██║  ██║██║╚════██║   ██║   ██║   ██║██╔══██╗   ██║   ██║   ██║╚════██║
██████╔╝██║███████║   ██║   ╚██████╔╝██║  ██║   ██║   ╚██████╔╝███████║
╚═════╝ ╚═╝╚══════╝   ╚═╝    ╚═════╝ ╚═╝  ╚═╝   ╚═╝    ╚═════╝ ╚══════╝
Last Updated on Thursday, 23 July 2015 23:29