# Andreas Kling

I like computers!

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## MutexProtected: A C++ Pattern for Easier Concurrency

DevFeed: [MutexProtected: A C++ Pattern for Easier Concurrency](<https://devfeed.tech/articles/mutexprotected-a-c-pattern-for-easier-concurrency-38361.md>)

Original publisher: [Read original article](<https://awesomekling.github.io/MutexProtected-A-C++-Pattern-for-Easier-Concurrency/>)

Author: Andreas Kling

Published: 2023-04-06T00:00:00Z

Content type: tutorial

Language: en

Sources: [Andreas Kling](<https://devfeed.tech/sources/andreas-kling.md>)

Topics: [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Code](<https://devfeed.tech/topics/code.md>), [Deadlock](<https://devfeed.tech/topics/deadlock.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [callback](<https://devfeed.tech/tags/callback.md>), [class](<https://devfeed.tech/tags/class.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [cpp](<https://devfeed.tech/tags/cpp.md>), [locks](<https://devfeed.tech/tags/locks.md>), [mutex](<https://devfeed.tech/tags/mutex.md>), [programming](<https://devfeed.tech/tags/programming.md>), [serenityos](<https://devfeed.tech/tags/serenityos.md>), [technical](<https://devfeed.tech/tags/technical.md>), [type-system](<https://devfeed.tech/tags/type-system.md>)

### AI overview

This tutorial explains the MutexProtected pattern, which combines a mutex and protected data behind a callback-based C++ API. It compares manual locking in C with C++ RAII and the newer pattern, showing how the design reduces forgotten-lock errors and encodes the mutex-data relationship in the type system. It also notes that inconsistent ordering of multiple MutexProtected instances can still cause deadlocks.

### Source excerpt

In this post, we will discuss the challenges of programming with locks and how the C++ language offers some useful tools to make it easier. We will start with an example in C and then use C++ to improve upon it in steps. The example APIs are based on real-life APIs from the SerenityOS kernel.

## How SerenityOS declares ssize\_t

DevFeed: [How SerenityOS declares ssize\_t](<https://devfeed.tech/articles/how-serenityos-declares-ssize-t-38356.md>)

Original publisher: [Read original article](<https://awesomekling.github.io/How-SerenityOS-declares-ssize_t/>)

Author: Andreas Kling

Published: 2023-04-04T00:00:00Z

Content type: opinion

Language: en

Sources: [Andreas Kling](<https://devfeed.tech/sources/andreas-kling.md>)

Topics: [C](<https://devfeed.tech/topics/c.md>), [POSIX](<https://devfeed.tech/topics/posix.md>), [Operating system](<https://devfeed.tech/topics/operating-system.md>), [compilers](<https://devfeed.tech/topics/compilers.md>), [standard](<https://devfeed.tech/topics/standard.md>), [Library](<https://devfeed.tech/topics/library.md>)

Tags: [c](<https://devfeed.tech/tags/c.md>), [compilers](<https://devfeed.tech/tags/compilers.md>), [cpp](<https://devfeed.tech/tags/cpp.md>), [libraries](<https://devfeed.tech/tags/libraries.md>), [library](<https://devfeed.tech/tags/library.md>), [posix](<https://devfeed.tech/tags/posix.md>), [serenityos](<https://devfeed.tech/tags/serenityos.md>), [standard](<https://devfeed.tech/tags/standard.md>), [technical](<https://devfeed.tech/tags/technical.md>), [unix](<https://devfeed.tech/tags/unix.md>)

### AI overview

This article explains how SerenityOS declares ssize_t using a C preprocessor macro technique. It contrasts the approach with more architecture-specific declarations commonly used by other C libraries and notes the limitations of the hack.

### Source excerpt

This post explores one of my favorite hacks in SerenityOS. I don't recommend doing this in your codebase, but it has worked for us so far. :^)

## How I make a living working on SerenityOS

DevFeed: [How I make a living working on SerenityOS](<https://devfeed.tech/articles/how-i-make-a-living-working-on-serenityos-38355.md>)

Original publisher: [Read original article](<https://awesomekling.github.io/How-I-make-a-living-working-on-SerenityOS/>)

Author: Andreas Kling

Published: 2022-10-29T00:00:00Z

Content type: opinion

Language: en

Sources: [Andreas Kling](<https://devfeed.tech/sources/andreas-kling.md>)

Topics: [Open Source](<https://devfeed.tech/topics/open-source.md>), [Operating system](<https://devfeed.tech/topics/operating-system.md>), [Development](<https://devfeed.tech/topics/development.md>), [GitHub](<https://devfeed.tech/topics/github.md>)

Tags: [community](<https://devfeed.tech/tags/community.md>), [development](<https://devfeed.tech/tags/development.md>), [github](<https://devfeed.tech/tags/github.md>), [non-technical](<https://devfeed.tech/tags/non-technical.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [personal](<https://devfeed.tech/tags/personal.md>), [project](<https://devfeed.tech/tags/project.md>), [serenityos](<https://devfeed.tech/tags/serenityos.md>), [support](<https://devfeed.tech/tags/support.md>), [systems](<https://devfeed.tech/tags/systems.md>)

### AI overview

Andreas Kling explains how recurring individual sponsorships and donations, including Patreon and GitHub Sponsors, support his full-time work on SerenityOS. He also discusses YouTube as a secondary source of income and frames the post as a transparency report.

### Source excerpt

This post describes in detail how I support myself while working on the SerenityOS project.

## Ladybird: A new cross-platform browser project

DevFeed: [Ladybird: A new cross-platform browser project](<https://devfeed.tech/articles/ladybird-a-new-cross-platform-browser-project-38358.md>)

Original publisher: [Read original article](<https://awesomekling.github.io/Ladybird-a-new-cross-platform-browser-project/>)

Author: Andreas Kling

Published: 2022-09-12T00:00:00Z

Content type: article

Language: en

Sources: [Andreas Kling](<https://devfeed.tech/sources/andreas-kling.md>)

Topics: [browser](<https://devfeed.tech/topics/browser.md>), [cross-platform](<https://devfeed.tech/topics/cross-platform.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Web](<https://devfeed.tech/topics/web.md>), [CSS](<https://devfeed.tech/topics/css.md>), [Document Object Model (DOM)](<https://devfeed.tech/topics/dom.md>), [ECMAScript](<https://devfeed.tech/topics/ecmascript.md>), [HTML](<https://devfeed.tech/topics/html.md>), [Qt](<https://devfeed.tech/topics/qt.md>), [Graphics](<https://devfeed.tech/topics/graphics.md>), [SVG](<https://devfeed.tech/topics/svg.md>)

Tags: [browser](<https://devfeed.tech/tags/browser.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [cross-platform](<https://devfeed.tech/tags/cross-platform.md>), [css](<https://devfeed.tech/tags/css.md>), [gui](<https://devfeed.tech/tags/gui.md>), [html](<https://devfeed.tech/tags/html.md>), [ladybird](<https://devfeed.tech/tags/ladybird.md>), [serenityos](<https://devfeed.tech/tags/serenityos.md>), [svg](<https://devfeed.tech/tags/svg.md>), [technical](<https://devfeed.tech/tags/technical.md>)

### AI overview

The post introduces Ladybird, a cross-platform browser built from the SerenityOS LibWeb and LibJS engines. It explains the project's origins, its shift from a SerenityOS browser engine toward a broader cross-platform browser, and its C++ architecture using Qt, HTML, DOM, CSS, SVG, ECMAScript, graphics, and image-format components.

### Source excerpt

This post describes the Ladybird browser, based on the LibWeb and LibJS engines from SerenityOS.

## Memory safety for SerenityOS

DevFeed: [Memory safety for SerenityOS](<https://devfeed.tech/articles/memory-safety-for-serenityos-38360.md>)

Original publisher: [Read original article](<https://awesomekling.github.io/Memory-safety-for-SerenityOS/>)

Author: Andreas Kling

Published: 2022-05-19T00:00:00Z

Content type: article

Language: en

Sources: [Andreas Kling](<https://devfeed.tech/sources/andreas-kling.md>)

Topics: [Memory Safety](<https://devfeed.tech/topics/memory-safety.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Programming language](<https://devfeed.tech/topics/programming-language.md>), [systems](<https://devfeed.tech/topics/systems.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [cpp](<https://devfeed.tech/tags/cpp.md>), [jakt](<https://devfeed.tech/tags/jakt.md>), [memory-safety](<https://devfeed.tech/tags/memory-safety.md>), [programming-language](<https://devfeed.tech/tags/programming-language.md>), [serenityos](<https://devfeed.tech/tags/serenityos.md>), [systems](<https://devfeed.tech/tags/systems.md>), [technical](<https://devfeed.tech/tags/technical.md>)

### AI overview

The post explains SerenityOS's plan to improve memory safety. It describes why the project is moving away from C++, the author's exploration of memory-safe systems languages, and the possibility of designing a new programming language.

### Source excerpt

This post describes how we're going to achieve memory safety in SerenityOS.

## I quit my job to focus on SerenityOS full time

DevFeed: [I quit my job to focus on SerenityOS full time](<https://devfeed.tech/articles/i-quit-my-job-to-focus-on-serenityos-full-time-38357.md>)

Original publisher: [Read original article](<https://awesomekling.github.io/I-quit-my-job-to-focus-on-SerenityOS-full-time/>)

Author: Andreas Kling

Published: 2021-05-28T00:00:00Z

Content type: opinion

Language: en

Sources: [Andreas Kling](<https://devfeed.tech/sources/andreas-kling.md>)

Topics: [Operating system](<https://devfeed.tech/topics/operating-system.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Unix](<https://devfeed.tech/topics/unix.md>), [WebKit](<https://devfeed.tech/topics/webkit.md>), [web browser](<https://devfeed.tech/topics/web-browser.md>)

Tags: [apple](<https://devfeed.tech/tags/apple.md>), [browser](<https://devfeed.tech/tags/browser.md>), [kernel](<https://devfeed.tech/tags/kernel.md>), [non-technical](<https://devfeed.tech/tags/non-technical.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [personal](<https://devfeed.tech/tags/personal.md>), [programming](<https://devfeed.tech/tags/programming.md>), [serenityos](<https://devfeed.tech/tags/serenityos.md>), [technical](<https://devfeed.tech/tags/technical.md>), [unix](<https://devfeed.tech/tags/unix.md>)

### AI overview

The author recounts leaving a job focused on web browsers to work full time on SerenityOS, an operating system inspired by 1990s graphical interfaces and late-2000s Unix command-line tools. The project grew from personal experimentation into an open source community.

### Source excerpt

Hello friends! :^) Let me tell you a story...

## Smarter C/C++ inlining with \_\_attribute\_\_((flatten))

DevFeed: [Smarter C/C++ inlining with \_\_attribute\_\_((flatten))](<https://devfeed.tech/articles/smarter-c-c-inlining-with-attribute-flatten-38362.md>)

Original publisher: [Read original article](<https://awesomekling.github.io/Smarter-C++-inlining-with-attribute-flatten/>)

Author: Andreas Kling

Published: 2020-04-27T00:00:00Z

Content type: tutorial

Language: en

Sources: [Andreas Kling](<https://devfeed.tech/sources/andreas-kling.md>)

Topics: [inlining](<https://devfeed.tech/topics/inlining.md>), [c/c++](<https://devfeed.tech/topics/c-c-plus-plus.md>), [Optimization](<https://devfeed.tech/topics/optimization.md>), [clang](<https://devfeed.tech/topics/clang.md>), [gcc](<https://devfeed.tech/topics/gcc.md>), [build times](<https://devfeed.tech/topics/build-times.md>)

Tags: [build-times](<https://devfeed.tech/tags/build-times.md>), [c-c-plus-plus](<https://devfeed.tech/tags/c-c-plus-plus.md>), [clang](<https://devfeed.tech/tags/clang.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [cpp](<https://devfeed.tech/tags/cpp.md>), [function](<https://devfeed.tech/tags/function.md>), [gcc](<https://devfeed.tech/tags/gcc.md>), [inlining](<https://devfeed.tech/tags/inlining.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [performance](<https://devfeed.tech/tags/performance.md>), [technical](<https://devfeed.tech/tags/technical.md>)

### AI overview

This post explains how to use the __attribute__((flatten)) function attribute in C/C++ to apply aggressive inlining selectively. GCC and Clang support the attribute, which inlines a function's callees while limiting the program-size, cache-locality, and build-time costs of broader inlining.

### Source excerpt

This post describes a compile-time technique for getting the benefits of aggressive inlining in hot code while protecting cool code from its downsides.