State Machine and Synchronization

This is the second of two notes of Lamport's Time-Clock paper[1]. The first one is here. The problem We will be focusing on how to use Logical Clock to solve an actual problem. The problem is to grant the resource to a process, that a process which has been…

A Look into Return Value Optimization of C++

I am learning C++ and ran into a "bizarre" issue, which was because Return Value Optimization (RVO) took place. In the spirit of learning C++, let's take a look into what's happening here. This is the code we will be looking at. struct Foo { Foo() { cout <<…

Time and Order

This is the first of two notes of Lamport's Time-Clock paper[1]. Abstract Order is a more basic concept than Time. And it's critical to how we reason. However physical time, which even though gives us total ordering on all events, cannot be observed within the system. So, we introduced…