development

Internals of Linux Process Signals

Linux Signals A process in Linux is represented as task_struct. A process A sends a signal to process B using system call kill() or kill -<sig num> <pid>. Kernel updates the task_struct of the receiving process B. It changes the signal field with the passed value. The scheduler checks the signals on a process before […]

Read more
development

Height of a Binary Tree: Recursion Unrolled & Explained

— tags: >- development, C++, tree, height, programming, recursion, internals, complete flow categories: development — Height of a Binary Tree is the longest path in the tree. Code int getHeight(node *root) { if (root == NULL) { return -1; } int leftHeight = getHeight(root->left); int rightHeight = getHeight(root->right); return (max(leftHeight, rightHeight) + 1); } Suppose […]

Read more
development

Notes on Dockerfile and Build Cache

Dockerfile is an instruction set to set up a new container. It looks like a BASH script that serially runs all the mentioned commands. The commands are predefined by Dockerfile syntax. Unlike BASH script, Dockerfile runs and applies effects of a command to the output of the previous step. Each step of a Dockerfile creates, […]

Read more
development

xargs: ls: terminated by signal 13

The following command hits a problem with sig 13. $ find . -type f|xargs ls -altr|head -rw-r–r– 1 root root 254111 Mar 17 2018 ./60/62 -rw-r–r– 1 root root 135111 Mar 17 2018 ./60/66 xargs: ls: terminated by signal 13 Why did it fail? $ strace find . -type f|xargs ls -altr|head newfstatat(AT_FDCWD, “xyxyx”, {st_mode=S_IFREG|0644, […]

Read more
design, go, golang, internals

Go Runtime Scheduler Design Internals

Concurrency is one of the most exciting features of Go language. A single threaded program runs serially, but if you have tasks that can run concurrently, you create threads for such tasks. Threads execute independently and progress concurrently. Go supports creation of thousands of threads in an application!! How is it possible? It’s Go’s runtime. […]

Read more