Giacomo Catenazzi: Re: "C and multithreading"
On debian planet. I read the C and multithreading post of Miriam Ruiz, but I don't agree with some conclusions:
First of all, I don't agree with Linus. C standard doesn't allow such optimizations. One of the driving point of C standard (and thus C) is that compiler should do what a programmer write, without much optimization, i.e. C should remain a low level language. It was iterated also for the principles of new C1X standard.
Second point. Volatile is not the right solution. volatile means that a variable should be read every time it is accessed, so the variable should not be but in registers (remember the nearly obsolete register keyword).
The problem of multi threading is not only that variables could changes (but this is a fact also of
single thread programs, when you write a signal handler [which are specified in C standard and which are handled correctly]), but for semaphores there are "barriers", i.e. you should not move read or write across such barriers.
What do volatile have with barriers? Nothing. If you read the standard (you can check also only the one page C appendix), you see that C specify what are the "standard" barrier, and they are nearly in all obvious points (i.e. a ";" is also a barrier), so moving instructions is "illegal" for C.
Ok. volatile had few other barriers, but across ";" there is already a barrier, so volatile is not the solution of barrier problem (AB locking).
References: see C wiki and C standard.
First of all, I don't agree with Linus. C standard doesn't allow such optimizations. One of the driving point of C standard (and thus C) is that compiler should do what a programmer write, without much optimization, i.e. C should remain a low level language. It was iterated also for the principles of new C1X standard.
Second point. Volatile is not the right solution. volatile means that a variable should be read every time it is accessed, so the variable should not be but in registers (remember the nearly obsolete register keyword).
The problem of multi threading is not only that variables could changes (but this is a fact also of
single thread programs, when you write a signal handler [which are specified in C standard and which are handled correctly]), but for semaphores there are "barriers", i.e. you should not move read or write across such barriers.
What do volatile have with barriers? Nothing. If you read the standard (you can check also only the one page C appendix), you see that C specify what are the "standard" barrier, and they are nearly in all obvious points (i.e. a ";" is also a barrier), so moving instructions is "illegal" for C.
Ok. volatile had few other barriers, but across ";" there is already a barrier, so volatile is not the solution of barrier problem (AB locking).
References: see C wiki and C standard.

Reading
Sheep Farmers Daughter is an old favourite, which I
have read lord only knows how many times. Elizabeth Moon has
written a gritty, enthralling story of the making of a Paladin.
This is the first book of a trilogy, and introduces us to a new
universe through the eyes of a young innocent (which is a great
device to introduce us to a universe from the viewpoint of someone
who is not seeing it through eyes jaundiced by experience).
For me, books have always been an escape from the humdrum
mundanity of everyday existence. Putting myself in the shoes of a
character in the story is the whole point; and this story excels
there: it is very believable. Not many people can tell a tale that
comes alive, and Ms Moon is one of them. An ex-marine, much of the
detail of the military life of Paks has been drawn from Moon s own
military experience. More than just that, the world is richly
drawn, and interesting.
I read this book in a hotel room in Chicago, since, as usual,
there was nothing really interesting on TV, and I don t get the
whole bar scene.
Although I have no idea what necessitated the use of
I wasn't going to post again today, but
After DebConf7, I started to work with the
Overall, tmpfs is implemented in mm/shmem.c. In
the initialisation function the file system is mounted internally by
the kernel with vfs_kern_mount so it is always around. It
gets fairly complicated because it has to keep track of swapped out
pages and the general complexity that come with implementing a full
filesystem.
As described above, there are several distinct ways to get access
to this file system.
As often seems to be the case, my internet at home vanished shortly after I arrived in Portland. Remote debugging (hurrah for flatmates) revealed that the modem would come up, start a PPP session and then OOM around 30-40 seconds later. This was kind of odd, since running ps in a tight loop showed that it wasn't the PPP daemon that was taking up all the extra RAM. Once we'd pretty much ruled out userland, that left the kernel. Limiting the value in /proc/sys/net/ipv4/ip_conntrack_entries brought stability back, but left us wondering why it had suddenly broken (and, of course, made it difficult to actually route anything...). /proc/net/ip_conntrack showed a bunch of ssh connections. Lots of ssh connections. All coming from one machine inside the network, but targeted at a large number of machines with roughly consecutive IP addresses.
I don't think such a gallery exists, but it should. Here's a my first
contribution, found in a website background.
On Sept 30th 1997, alternated traffic regulation was decided in Paris for the day, because of a pollution peak.
As of now, this has been the one and only time this decision was applied and it won't probably happen again because of many (stupid) limitations:

