More thoughts on change and typedefs

Of course, now that I’m well into using the “option 4” I start to remember why I kept sliding back from options 2 and 3 towards 1. Although option 1 uses native types instead of typedefs which is bad for all the reasons I listed in the previous post, the other options only give the illusion of type safety because they use typedefs… Of course I knew all of this, but it doesn’t hurt to go full circle and remind yourself of the pain once in a while.

Pimp my hide

As some of you may have guessed, the fact that I’ve spent the last week working on a tool for my own use means that I’m a little light on client work right now. If anyone needs a Windows C++ guy drop me a line. There’s plenty of samples of my work on this site and more on CodeProject. I’m more than happy to quote you a fixed price for stuff if you know what you want.

In summary, don't summarise too soon

I’ve been working on my deadlock detection and lock monitoring tool quite a lot this week; that and fixing the issues that it’s been highlighting. Yesterday I decided that I was drowning in data and that I really needed a GUI and, as I thought about how the GUI should work, I realised that I really didn’t have enough data. Note: the deadlock detector mentioned in this blog post is now available for download from www.

Change is good

I like to experiment with new coding practices. Not too many at once mind you. I tend to add one new thing to how I work, operate in the new way for a while and then decide if the new way is worth adopting as a habit going forward. By adding new practices every so often I push my work habits in new directions; some of it is good, some is not so good, but all of it is an opportunity to learn.

Lots of answers but little help

I don’t read many newsgroups, I don’t have the time, but I take notice of the Windows networking ones as they’re low traffic and they’re relevant to a lot of the work I’m doing at present… I’ve noticed something that’s starting to bug me a bit and I’m not sure if it’s specific to Microsoft related technology newsgroups but I have a feeling that it might be… Anyway, the thing that bugs me is that there are some very active people who feel that they have to answer almost all new messages yet actually add very little value.

What's with CreateProcess and managed exes?

I have some code that launches another process in a suspended state, does some stuff (tm) and then resumes the process. This uses CreateProcess() and works fine on unmanaged exes. When I try and launch a manged exe with the same code the process starts up in a running state rather than in a suspended state. The docs for CreateProcess() don’t mention any strangeness. Does anyone know of any docs that explain what’s going on?

Viewing lock lifetimes

I added some more monitoring to the deadlock tool. You can now view the entire life cycle of the locks, from initialisation, through usage to destruction. The lock usage figures put the contention figures in context as you can see how often the lock was acquired by each thread and compare that to how often there was contention… Note: the deadlock detector mentioned in this blog post is now available for download from www.

Lock Free

I just ran my OpenSSL echo server test harness and ran the server under the deadlock tool. The results are interesting and show that the main source of lock contention on the server is for the lock that protects the buffer allocator. Every read or write requires a buffer to be allocated and released. The SSL server actually requires more than one buffer for each read and write as passing the data through the SSL connector causes further buffer allocations.

Observing lock contention

The deadlock detection tool that I was working on last week is coming on nicely. I managed to locate two potential deadlocks that had never caused any problems in code that is running live on a client’s site. Once I had a report from my tool it was relatively easy to fix the problems. Both of these were real bugs that just hadn’t bitten yet. Today I added some rudimentary lock contention monitoring to the tool and the results seem to be quite useful…

It's Friday, so...

This G’n’R/Beatles mashup works surprisingly well, and brought a smile to my face earlier in the week - via Code Circle. And whilst we’re on the subject of music, Filip has started uploading some of his techno mixes…