Files Are Annoying

What happens if you call stat on a file on a network that went down? Do you get A) an IO error? B) An error like EAGAIN to suggest the stat won't complete for many milliseconds C) stat blocks until the network times out which could be many minutes

The answer is C. With linux you can work around the problem by using io_uring, but on windows and mac you're out of luck. They have async IO, but neither of those OSes seem to have a non-blocking stat nor a non-blocking open. I'll need to use threads and have them idle most of the time.

Week 12

This week I implemented a directory iterator. This doesn't solve the problem above but it does allow me to have easier to read code. Second I upgraded the coverage script so I have more coverage options, specifically which coverage tool to run (more than one is an option.) A previous option I implemented was to build using headless or gui. This works with that so if I'm trying to raise coverage on one specific file I can use the fastest coverage tool and use a headless build that compiles and executes quicker. Third I implemented an async substring search. The search implementation itself I took from my original bold source which uses SIMD and is well tested. This week is the async implementation around that substring search. Fourth I compiled and fixed all my code on mac. I use linux on my desktop so I sometimes don't compile on mac for weeks.

Changing Events Again

While writing the async substring code I didn't like how related functions were far away from each other. I have a worker queue that uses a callback to check how much a message 'cost' and tries to divide up the work across its queues. The 'cost' and 'process' callbacks have a giant switch statement. It was awkward that if I wanted to implement a small message I'd have to modify two large functions. I reworked it so I can use an interface. No more switch statements.