Skip to content

Instantly share code, notes, and snippets.

@hieubnt235
hieubnt235 / Event_Loop.md
Created October 27, 2025 13:20 — forked from kassane/Event_Loop.md
Explain Event Loop

Event Loop

In computer science, the event loop, message dispatcher, message loop, message pump, or run loop is a programming construct that waits for and dispatches events or messages in a program.

It works by making a request to some internal or external "event provider" (that generally blocks the request until an event has arrived), and then it calls the relevant event handler ("dispatches the event").

The event-loop may be used in conjunction with a reactor, if the event provider follows the file interface, which can be selected or 'polled' (the Unix system call, not actual polling).

The event loop almost always operates asynchronously with the message originator.

@hieubnt235
hieubnt235 / Matrix.md
Created October 5, 2025 04:10 — forked from nadavrot/Matrix.md
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@hieubnt235
hieubnt235 / nanobind-notes.md
Created October 4, 2025 06:20 — forked from MawKKe/nanobind-notes.md
My notes and observations about python nanobind + scikit-build-core usage

My notes and observations about python nanobind + scikit-build-core usage

nanobind is a tool and a library for implementing native C/C++ extensions for python. You can implement such extensions in many ways, but nanobind makes life a bit more easier, especially if you write C++ and use CMake to build your native code.

nanobind recommends using the scikit-build-core as the build backend; it handles the heavy lifting of building stuff through CMake during python package build process. It even supports using Ninja. And as a cherry on top, it is able to download CMake and Ninja from pypi if they are not available locally.