Blogs

Adventures with \Device\Afd

I’ve been playing around with Rust recently and whilst investigating asynchronous programming in Rust I was looking at Tokio, an async runtime. From there I started looking at Mio, the cross-platform, low-level, I/O code that Tokio uses. For Windows platforms Mio uses wepoll, which is a Windows implementation of the Linux epoll API on Windows and is based on the code that is used by libuv for Node.js. This uses networking code that is NOT your standard high-performance Windows networking code using I/O completion ports and instead uses the ‘sparsely documented’ \Device\Afd interface that lies below the Winsock2 layer.

Practical Testing: 39 - 19 years' unit testing the same code

Back in 2004 I started a series of blog posts called “Practical Testing”, about unit testing a non-trivial piece of C++ code. The idea was to show how adding unit tests to existing, real-world, code could be useful and could support future development and refactoring. Episodes 1 though 13 were written in 2004 and covered getting the code under test and fixing some bugs that were complicated to reproduce in a live environment.

Currently reading - Rust Brain Teasers

I’m currently reading Rust Brain Teasers by Herbert Wolverson. It’s a nice book of bite-sized puzzles in Rust that are ideal for the way I like to learn (randomly jumping around from subject to subject that happen to interest me). Each puzzle presents some code, asks you what you think it does and then shows you the hidden complexity. At the end of each section are some links to further reading.

LockExplorer is no more

I’ve finally done what I should have done several years ago and shut down the LockExplorer site. I haven’t had the time required to keep the tool up to date and fewer people were interested than I originally expected. I may make the source code available at some point.

SetServiceStatus framework bug

One of my clients has been reporting an intermittent issue with the deployment of new releases of their game server. This runs as a Windows service on many, many, cloud machines and, just sometimes, the service seems to have issues during start up after upgrading the code on a machine that it has otherwise been running fine on. I’ve been adding debug code to our service start up code to try and work out what’s going on and today we had our first hit.

Migrating to Hugo

I have just completed migrating the blog from Movable Type to Hugo. Hopefully everything still works and is in the right place, but do let me know if you find any issues. The comments have been migrated to Disqus. I’ve been wanting to update my websites for quite a while now. I spent quite a lot of effort trying to find someone to do it for me but all of the web companies seemed to lose interest when they realised that I didn’t want an ongoing “SEO” package (I’ve always viewed SEO as “snake oil”).

L'Hexapod: More than just a delay, it seems...

Previously published This article was previously published on lhexapod.com as part of my journey of discovery into robotics and embedded assembly programming. A full index of these articles can be found here. Back in 2010 I thought that the birth of my first son, Scott, would be just a small blip in my journey into robotics but, looking back, it seems to have been the end of that chapter. Of course, raising children takes time, and Scott was just the first; he was followed shortly after by Max and if I thought assembly and robotics was complex to learn it’s nothing compared to raising kids!

Rust - Threading

Previously published This article was previously published on len-learns-rust.com. A full index of these articles can be found here. Now that I have my generic IdManager I’d like to use it from multiple threads. As I said, this code would normally be used for things like connection ids for network protocols and I’ve spent the past 20 years or so writing servers that use small numbers of threads to handle many thousands of connections with work for each connection being given to a thread from a thread pool to perform.

Rust - The journey so far

Previously published This article was previously published on len-learns-rust.com. A full index of these articles can be found here. I’ve now built a generic IdManager which does everything I want it to do, for now. I’ve bumbled along in a very non-scientific manner, mostly using the compiler errors to guide me towards things I’ve then looked up on the web. The code works and is tested, but it’s now time to go back to the books with a series of questions that this journey has got me thinking about: