-
Gcc vs. Users
Development of the gcc compiler faces recurring tension between people who want gcc to generate better code and people who want gcc to support their style of programming. The languages which gcc supports all have standards which are intended to provide an interface between the programmer and the compiler. The programmer can assume that the…
-
Social Networking
Web sites like Facebook, MySpace, LinkedIn, Orkut are billed as community sites. You can connect to your friends, and find out what they are up to. It’s a good way to keep track of what people you know are doing. I have a page on three of these sites. Since I am not a very…
-
Single Threaded Memory Model
One more round on the parallel programming theme. There has been some recent discussion on the gcc and LKML mailing lists about an interesting case. static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; static int acquires_count = 0; int trylock() { int res; res = pthread_mutex_trylock(&mutex); if (res == 0) ++acquires_count; return res; } On x86 processors, current…
-
Gold Workqueues
The gold linker is multi-threaded. I’ll sketch the implementation I chose. I wanted to avoid using lots of fine-grained mutexes, because they are both error-prone and expensive. Instead, I used a workqueue system. This requires breaking up the job into, essentially, a state machine. The whole link is defined as a series of relatively independent…
-
Lock Collection
Memory management is a standard problem for programs written in C and C++. It is important to free memory when it is no longer needed, because otherwise you will run out. Unfortunately, it is complex to keep track of which memory is no longer needed. The symptoms of memory management problems are typically either running…