Category Archive: Algorithms

Jul 21

forkfd part 4: proposed solutions

Last week, I wrote three blogs about the situation with starting child processes on Unix and being notified of their exit. I raised several problems with the current implementation, which I have tried to solve and I have now a proposal for. If you haven’t yet, you should take some time to read the previous …

Continue reading »

Jul 13

forkfd part 3: QProcess’s requirements and current solution

In the previous posts onmy series of blogs about starting and managing sub-processes on Unix, I talked about how it’s implemented and how the current solutions have limitations. On this post, I’ll show how QtCore has solved the problem (to the extent that it can be solved) and what requirements a new solution must fulfill. …

Continue reading »

Jul 13

forkfd part 2: Finding out that a child process exited on Unix

On my previous blog, I said that the solutions we’ve got implemented on Linux are a good start, but not the full solution. We can start a child process properly, but we still can’t properly find out when it exited.

Jul 13

forkfd part 1: Launching processes on Unix

Have you ever tried to launch a sub-process on Unix? POSIX.1 has several APIs for doing that, including: fork+execve and posix_spawn. Starting a child process is not difficult, but ensuring that they behave properly and you get notified when the child dies, that is difficult.

Mar 28

Restricting what you can do

I usually write about C++, since it’s the programming language that I use on my daily work. Today, however, I’m talking about its nearest cousin: C. In specific, about a certain keyword introduced by the C99 standard, which was issued over 12 years ago. Usually, the C standard plays catch-up with the C++ standard (like …

Continue reading »

Jul 25

Table-driven development, meet C++0x

Last week, I blogged about table-driven development without creating relocations in memory. One of the comments I received indicated that the code was hard to read — I concurred, of course, as it is generated code. Then Olivier looked at it and decided to have a go at making it entirely generated by the compiler, …

Continue reading »

Jul 21

Initialising an array with C++0x using constexpr and variadic templates

When I wrote the blog on improving QString further, I said: If you can, use the following C++0x expression, which is read-only and sharable: That above actually does work and does produce a read-only and sharable QStringData containing the UTF-16 “Hello, World\n” string. However, what I didn’t say (because I hadn’t realised at the time) …

Continue reading »

Page optimized by WP Minify WordPress Plugin