In this article, I talk about thread-safety and a specific but common case of it. I didn’t cover the thread-safety concepts in detail and I briefly explain the related ones only. This article considers that the reader has some knowledge about thread-safety, operating system concepts and computer architecture.
Protecting the data from race condition is a complex job and there are various solutions. Generic thread-safety mechanisms (mutex, etc) work great but their performance impact on the system may be huge. In some cases, it is possible to develop lock-free algorithms or disable the locks, temporarily. Developing a customized thread-safety solution according to your needs, doesn’t only protect your data from race condition, it saves your system resources, speeding up your operations as well.
We will design a simple firewall that checks if the IP address of the client is allowed to show an example. Multiple threads will be executed and they will use a shared whitelist for this operation. We will keep the whitelist in a database and we won’t query it for every request. It is quite expensive. So, we will cache the data and update it (timely or depending on a trigger) ; a trigger would be better.
The project I developed from the ground up to bring different perspectives to the concept of operating systems. It will be an evolutionary, system adaptive and dynamic operating system and the features that are essential to an operating system will be included as well. It is an experimental project and aims to carry out scientific calculations. I will also share my methodologies on my website. I am developing the kernel from scratch. It does not relate to any other projects like Linux, etc.
Scientific researches, algebraic, cryptographic, engineering and physics applications are usually performed with big numbers which exceed typical data types of nowadays. So, arbitrary precision arithmetic is needed to do these tasks. Partitioning numbers into small parts and doing the calculation is the main principle. Divide and conquer philosophy lies behind it. In arbitrary precision arithmetic, just a classical addition operation takes lots of cycles. Multiplication and division operations have highest complexities.
Information
I completely translated my website into the English language. It is time for a new start.