Posts
Building Channels in C++: Part 7 - Fixing an infinite loop
Published:Apr. 7, 2025 In we added timeouts to the select statements we made in . These selects work pretty well. However, there is a sneaky hidden flaw. If we aren't careful, we'll deadlock…Building Channels in C++: Part 6 - Adding timeouts
Published:Apr. 5, 2025 In we created a select statement for our channels which can handle sending and receiving values. If you haven't already, I recommend reading that post before continuing with this one. Don't worry, this post will still be here.…Building Channels in C++: Part 5 - Writing a select statement
Published:Apr. 4, 2025 So far in this series, we've created a channel with blocking and non-blocking methods for sending and receiving messages. See for the last post in the series. So far, our channels (with the reader excersises) look like the following (it's getting big enough this will probably be the last time I start a post with the channel code)…Building Channels in C++: Part 4 - Going non-blocking
Published:Apr. 3, 2025 Previously in we got multi-threaded channels working. We could send and receive messages, and we could close channels to tell threads to stop using them. However, all of our operations were blocking. We didn't have anyway to try to do something in a non-blocking manner. We won't make a non-blocking version of close since when we want to close a channel, we really want to close the channel. The same principles we use to make non-blocking send and receive methods can be used to make a non-blocking close if you want…Building Channels in C++: Part 3 - Closing channels
Published:Apr. 2, 2025 So far with our channels we've been able to send and receive messages. And in we gave channels a static size.However, we don't have a way to signal to all consuming (and producing) threads that a channel shouldn't be used anymore. Without this, we can't safely clean up channels since threads won't know that a channel is no longer safe to use…Building Channels in C++: Part 2 Limiting Size
Published:Apr. 1, 2025 In we built a channel that could send and receive messages. However, there was no bounds on how big the channel could get. Before we go much further, we should start adding limits to the channel size. Changing how we view memory will start to shape how we approach our channel going forward, so it's better to addres it sooner rather than later…Building Channels in C++: Part 1 - The Adventure Begins
Published:Mar. 31, 2025 This is part 1 of a series in building channels (and several channel-related features) in C++. For this series, we're going to focus on thread-based channels instead of coroutine or fiber based channels. Because of that, there will be some limitations on what we can do and how much concurrency we can support. Also, we'll be implementing our select loop differently than if we were writing it for Go. However, we'll gain a base understanding of how channels works, and we'll see different strategies for synchronizing and communicating between threads…Casting Values to Integers and Floats in JavaScript
Published:Mar. 19, 2025 This post is mostly a quick reference for me to share with people about how casting values to integers and floats work in JavaScript - and the weirdness that can happen…Creating Documents
Published:Feb. 24, 2025 When I was rewriting my blog, I was trying to decide what format to put the posts in. I wanted a format that works well for both print and web, and that can create HTML and PDF files. Additionally, I have a hard "self-host" requirement - whatever I do I need to be able to do on my own hardware and not a remote server. I did some research on different document formats. I came across three main categories (though I'm sure there are probably still more). The categories I came across are are: markup, typesetting, and GUI-based…Rewriting my site generator
Published:Feb. 21, 2025 Lately I've been rewriting my site generator behind my blog. The old one was really finicky, had a terrible parsing strategy, and also wasn't what I actually wanted long term. Also, due to how I wrote the generator it was getting hard to add new features. Plus, every time I started it up I had to deal with NPM giving me a bunch of security vulnerability alerts since my XML parser was outdated. But, the next version of the parser was a completely different API for parsing and traversing XML documents, which would have required a rewrite just to get rid of those printouts. Additionally, I've been rewriting all my posts from Markdown to LaTeX so that I can print them out nicely, and I didn't want to keep maintaining two versions of my blog (one for print and one for web)…