Search Results: "ag"

9 November 2007

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.

Wouter Verhelst: Public Transportation

Christian Perrier blogs about how he uses public transportation to go to work, how that works well, and how that has positively affected his Debian productivity. Personally, I couldn't agree more. I've graduated from school in 2001; and the only time when I commuted to work by car was when I worked at template, where I had a company car because I had to make customer visits. Today, as an entrepreneur, I do everything by public transportation. It is my intention to, eventually, make sure I have a car because doing customer visits by public transportation isn't easy; but it's not impossible, either; you just need to make sure you're prepared. If I have an appointment at a customer, what I usually do is to go to the de lijn website, of the flemish public transportation company that handles buses and trams; they have a schedule online, and a route planner that allows me to do much of what Google Maps does for cars, but then for public transportation—including trains. If I do that on time (that is, earlier than half an hour or so before the appointment), I hardly ever have problems reaching my destination in time. Of course there are days when the system fails, and I'm stuck in a train station for longer than I'd like; but these are the exception, not the rule, especially outside rush hour. And like Christian mentions, the absense of having to pay attention to the road while commuting is a real bonus, in that it allows you to actually get some work done. Or sleep, if it's been a short night. Or look outside the window, if you have nothing better to do. Or hack. In fact, at DebConf7 in Edinburgh, I had a little discussion with Ian Jackson about how the train provides the perfect environment for hacking: nobody around to disturb you (except, occasionally, people to check your tickets, but you can just put your ticket in plain view all the time and they'll be happy without you getting out of deep hack mode), and the view out the window is just perfect to stay concentrated: no still image to get distracted by, but nothing boring either. We theorized that it'd be nice if you could just go to the train station and state "I need a ticket. The destination isn't important, but I want to be waiting as little as possible and end up here again in about 2 hours". The only problem with that, of course, is that train rides aren't free, and that office rent is much more affordable...

Ondřej Čertík: Mercurial vs git for managing Debian packages

I was used to managing all my packages in a Subversion repository, but now when we moved from Subversion to Mercurial in SymPy, I somehow prefer Mercurial for all my work now. :) We chose Mercurial, because I found it a little more polished than git, also the commands are the same as in Subversion.

I like the git-buildpackage, that it manages everything in one repository and that's it, and also that it's written in Python. One would expect that when Mercurial is written in Python, that hg-buildpackage would be too, but it's written in Haskell, so I cannot easily fix it. I filed a wishlist against the hg-buildpackage, whether it is a good idea to provide the same interface as git-buildpackage.

So for now I am going to try git for packaging things in Debian.

Biella Coleman: Tokyo around the corner

So this Sunday I am off to Japan along with a few other members of my department for a week long visit. I am going to attend a conference being hosted by the Interfaculty Initiative in Information Studies at the University of Tokyo. The number of faculty members housed under this initiative is simply impressive and I look forward to meeting many of them and learning how they are conceptualizing and moving forward with the interdisciplinary study of digital society. I have not had much time to think about the trip outside of 1) how do I get to my hotel 2) preparing for my presentation but I will have a little free time on Tuesday, Thursday morning, Sunday morning and a few evenings to see some sights and see some people. With the help of Junichi and others, we are organizing a gathering with Debian developers as well as the local and some visiting Creative Commons folks on Wed night, the 14th of November. Do come around if you are there and interested (and you can leave me a comment or email me at biellaATnyuDOTedu too. While I basically am going to be like-a-lemming and follow my colleagues who have made some plans, if you think there is something Not To Be Missed in Tokyo, do leave a shout out in my comments or ping me via email. I would appreciate it!

8 November 2007

Miriam Ruiz: C and multithreading

Reading mig21’s weblog, in which I often find really interesting stuff, I found Ian Lance Taylor’s article “Single Threaded Memory Model“, which kind of bothers me a bit. It reports a recent discussion on the gcc and LKML mailing lists about how C compilers, gcc in this case, optimize for single threaded code, sometimes leading to counter-intuitive results which won’t work properly in multi-threaded software (leading, for example, to race conditions). The interesting part is that the C language standard, which in general describes a single threaded model, apparently says nothing about when values have to be written to memory. Thus, this kind of optimization seem to be perfectly valid. Linus Torvalds complains about gcc developers taking more care about “what the spec says” than about real problems, but the fact is that if those kind of optimizations are valid according to the specs, there’s no guarantee at all that it won’t happen with whatever C compiler you might be using. To prevent this kind of behaviour in standard C, according to Ian, the variable needs to be marked as volatile, or it needs to use an explicit memory barrier. The moral in this case is that multithreading might not be as easy as it seems and should be handled with caution.

Manoj Srivastava: Manoj: Deeds of Paksenarrion

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.

Benjamin Mako Hill: Ideal Accidents

Although I have no idea what necessitated the use of Ideal caution tape on the revolving door at the Hotel @ MIT, I'm quite sure it wasn't. /copyrighteous/images/ideal_caution_tape.jpg

MJ Ray: The Conservative Co-operative Movement

I wasn't going to post again today, but the launch of The Conservative Co-operative Movement says something fundamental about the insanity of UK politics. I'm just not sure *what*. I've kicked off a discussion and poll on Co-opNet about the CCM to see what reaction it gets.

MJ Ray: Current Issues / Petition against NHS primary care use of high-cost phone numbers

I have signed http://petitions.pm.gov.uk/NGN-use-by-GPs/ because calling your local doctor should be a local-rate call.  Also, most calls-included telephone packages don't include those 084 and 087 numbers.

In February 2008, 0870 numbers will change from being revenue-sharing to costing most users money.  It will be interesting to see whether 0870-using doctors change their phone numbers and inconvenience their patients further.  (My company is changing to an 0844 for extra services and we have 01 and 07 numbers for specific tasks.)  I think recent new users like Milton surgery have been using 084.

MJ Ray: Mozilla Firefox and IceWeasel

This follows last year's problems with Mozilla packages. FTP.mozilla.org now has a (Not-?)Firefox 2.0.0.9 "compiled with branding, logos and talkback removed" according to John O'Duinn's Soapbox - download non-automated en-US free-software builds. Is this really free? What does it mean for Debian's Iceweasel and GNU's Iceweasel if so? I guess the GNU one will keep going, to avoid the auto-installation of non-free plugins, but it might allow more work to be shared.

MJ Ray: Suggestions / E-Democracy

After being out training and meeting in London and Essex on Monday, I popped up to Bristol on Tuesday to meet Tim Erickson of e-democracy.org and hear about recent developments.  In the entertainingly-named Star Books cafe near Old Market, which I'd wholeheartedly recommend, I chatted with him a bit about new developments here, in Norfolk and on E-Democracy and DoWire. I also mentioned about Yatton Parish Council's website being taken offline, reportedly for linking to kiddie porn.

Would it be good for WsMForum to do more E-Democracy?  With recent topics about transport and the NHS, it might happen anyway, but it is a direction we should push, connecting people with their representatives?

Then I tagged along and finally saw Bristol Wireless Community Co-operative's base at St Werberghs before clearing off back to work.  I've met some of their members at various events before and they seem to be doing fantastic stuff.  You can read (and hear) more about them on Tim's blog.

MJ Ray: Oops I did it again

I wrote a lot of messages on Sunday, trying to clear some things up and start a few slow balls rolling before various workshops, meetings and training sessions this week. Sadly, I botched at least three subject lines. One was the "Dear Blogger" post on this site which was written to someone who blogs, not Google's Blogger site. Few people saw the second mistake, so I'll not republish it here. The third was trying to ask whether debian t-shirts like the one I wear are affected by the Uzbek cotton problems which were in the news several times last week. That was on debian-project so I got some personal abuse for the botched subject. Debian lists are more funny than fun - some people get less flak for mailing violent threats than I do for a misjudged subject line... Oh, and about the cotton-picking: it appears the debian project doesn't know where material for debian-branded clothing comes from and some seem to argue strongly that we should remain ignorant of it...

Martín Ferrari: I (heart) pkg-perl

After DebConf7, I started to work with the Debian Perl Group, which I think is an example of how good a packaging group can work. We maintain currently 400+ packages, with a log bug-count (0.11 active bugs per source package says asdfasdf, and it's not like we are a lot of people there. To be honest, I haven't been too active on the packaging front, but I spent countless hours on tweaking and modifying what I think it's the most important tool for the group success: a script that generates a webpage where you can instantly see the status of every package in the SVN repository. The great thing about this is that it gives you a visual idea of the status of everything in a moment: which packages have bugs, which one are ready to be uploaded, and —since we keep all watchfiles updated— also which have a new upstream version. Being a group with many non-DDs, it's great that there's no need for maintaining a list of to-be-sponsored packages; we just mark the package as ready to go, and when somebody can do it, reviews and uploads the package. I can hear the cries of people who think that sponsored packages are the incarnation of the devil, but our bugcount backs me :-). I tell you all of this because, first of all, I'm really glad to be part of a healty group of great people, and secondly, because we are finishing a completely new version of the tool, which was thought from the beggining to be used by other groups. In fact, a lot of debugging has been done by checking that it could process correctly other groups' data (it only works with SVN by now, but that's easily fixable as the code is pretty modular). You can see the (static) pages I've done while testing, showing the packages from the Collab-maint, Games, Java, KDE and Python-modules teams/groups. If you find a bug, I'd love to hear about it. So, if you're interested, grab the sources from the repository, and drop in #debian-perl@OFTC if you need help. Tags: Planet Debian, Debian

Ian Wienand: Shared memory on Linux

You may have noticed a range of things mounted on a tmpfs file system.
$ mount   grep tmpfs
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs is actually more pervasive than it might appear. It was created to build a filesystem interface ontop of shared pages of RAM. This is useful because there are a number of ways to access shared RAM; notably SysV IPC Shared Memory (shmget, shmat, etc) and mmap of anonymous memory (MAP_ANONYMOUS). In order to have a consistent infrastructure implementing all of this the kernel abstracts RAM as a filesystem and your mapping as a file. To this end the tmpfs filesystem was created to present this abstraction. It deals with issues such as caching, security and the ability to swap pages in a consistent manner (i.e. using the same infrastructure every other file system does). Linux shared memory overview 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. tmpfs: more than meets the eye! Update: hopefully a little clearer, thanks to Helge Bahmann for comments.

Matthew Garrett

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.

At this point, I remembered a party a month or so ago. One where I'd created an account on the TV machine to let people upload stuff to play. An account I'd cunningly called "media", giving it the highly secure password of "media". I blame vodka from Ikea.

You can guess where this is going.

Unplugging the TV machine resulted in everything rapidly returning to its normal state. I'm sure there's some sort of important lesson here, but I'm sure I don't know what.

7 November 2007

Joey Hess: gallery of images that make you unnecessarily clean your display

I don't think such a gallery exists, but it should. Here's a my first contribution, found in a website background. tileJournalBG.gif

Christian Perrier: 10 years of public transportation

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: Anyway, when this happened, I was, like dozens of millions of moron^W people in the Paris area, driving from my home to my work place (the same home and workplace than now): 30km one way, between 30 and 120 minutes (most of the time 45-60). I then decided to try using public transportation for one full month and then see if I can survive it (as many people who seldom use public transportation, I had horror stories in mind, such as full trains, no respect of schedules and of course, the horrific FRENCH STRIKES). This was 10 years ago and I never stopped. Since then, my daily trip is: So, about 75 minutes from my home to my work place. 30-60 minutes "lost" per day? Not really. In the train, I can read, sleep (funnily an internal system always wakes me up at the right moment) and of course, hack on my laptop (which is my most common activity there). This, quite comfortably with enough room for my arms, feet. The same goes for the bus rides (I don't suffer from car sickness). I still haven't found a way to hack while walking (but I found some free Wifi spots at some bus stops). So, in my opinion, I *won* 90 minutes a day. And, indeed, Debian benefits it a lot as this moment is my privileged moment to work on my packages, or write stupid things in my blog, or just hack around and look for things to improve in our favourite distribution. In 10 years, I of course have a few "horror stories" about crazy schedules, missed busses and of course the awful FRENCH STRIKES. About the latter, the reality is that I just have to look at the special schedules on strike days...and spot the few trains that are schedules (either 1 every 30 minutes or, at worst, 1 every hour....when the usual schedule is 1 every 15 minutes)...and then I reach my home/work pretty safely, while many moron^W other peopl suffer from awful traffic jams on highways. So, in short, here am I, ready for 10 more years of public transportation use and being seen as an ET in my neighbourhood because I leave home by WALKING even if I am not a high school teenager. Strange person, indeed? Not to forget: from my records, I saved about EUR41,700 by doing this, assuming a cost of 0.4EUR/km, 60km/day, 200days/year for the car trips....and EUR623/year for my transportation card. I should buy a brand new SUV..:-)

David Welton: YUI Compressor

One of the things I love about programming is that you are always learning new things. You have to learn new things to keep up. One of the benefits of using the Plotr Javascript library for the language popularity stats I did is that instead of having to download separate images for each statistic, a user just fetches the library once and then a few small bits of data for each chart, which is probably a net savings, especially when I start to add more statistics. However, Plotr, plus its various supporting libraries, is fairly hefty, so I needed to find a way to compress it. One of the helpful people on the freenode IRC network's #javascript channel pointed me at Yahoo's YUI Compressor, which is a nicely done project that squeezes quite a bit out of Javascript files. I would recommend it to anyone else who needs to pare down their production JS files to the bare minimum. Best of all, it's available under a very liberal open source license! Incidentally, over the course of the language stats project, I was surprised at how much helpful stuff Yahoo provides, first and foremost, a real API for their search engine, something that Google no longer has. Hopefully, it's a sign of better things to come for them (if for no other reason than to keep Google on their toes!). By the way, for those interested in the language stats project, I set up a forum with RSS feeds, where I will be posting updates, and accepting suggestions for further improvements.

Benjamin Mako Hill: Revealing Errors

Groups that campaign for free technology, like the Free Software Foundation and the Electronic Frontier Foundation, tend to be supported primarily by technologists. Both groups have struggled to communicate their messages to non-geeks. I have written an article and helped create a new weblog, both called Revealing Errors, that attempt to address a root cause of this issue in what I hope is both an insightful and entertainingly manner. Geeks support groups like the FSF and EFF because, as people who understand technology, they understand just how powerful technology is. Geeks know that control of our communication technologies is control over what we can say, who we can say it to, and how and when we can say it. In an increasingly technologically mediated age, control over technology is not only the power to control our actions; it is the power to limit our possible actions. Our freedom to our technology is our freedom, full stop. This message fails to resonate with non-geeks but it does not fail because non-geeks are happy to hand over their freedom. It fails to resonate simply because the vast majority of people do not understand that technology, and control over it, is powerful enough to impact their freedom. Most people fail to see the power because, quite simply, most people fail to see technology. While we all see the effects of technologies, the technologies themselves are frequently hidden. We see emails but not mail transport agents. We see text messages but not the mobile phone network. Before one can argue that such systems must be free, one must reveal their existence. Technologists are keenly aware of the existence of these systems. To everyone else, they are completely invisible. Marc Weisner of Xerox PARC cited eyeglasses as an ideal technology because, with spectacles, "you look at the world, not the eyeglasses." When technology works smoothly, its nature and effects are invisible. But technologies do not always work smoothly. A tiny fracture or a smudge on a lens renders glasses quite visible to the wearer indeed. Similarly, people see their MTAs when messages bounce. They see Windows on their ATM or phone when the system crashes. Technological errors are moments when usually invisible technology becomes visible. They are, in this sense, also an educational opportunity. /copyrighteous/images/blue_screen.jpg I have recently published an article in Media/Culture Journal from the University of Melbourne within a special issue called Error. If you are interested in learning more about what I'm trying to do or looking at some examples, please read the article. With support and ontributions from Aaron Swartz, I have also created a new weblog, Revealing Errors, that reveals errors that reveal technology by posting descriptions of errors with commentary on what the error reveals. I've posted a few examples there already and I will be updating it regularly. The goal is to help explain the power and influence of technology in the service of broadening the base of people who can get excited about freedom to technology. Eventually, I hope to be able to communicate this message to a less technical audience. With that said, I hope that even seasoned technologists will learn things about their technological environment through the analysis and interaction. I hope readers of this blog will subscribe to it and, if possible, comment on and contribute to the project as it moves forward.

Bernd Zeimetz: python-application

python-application … is what I'm in love with since a few days. Although I had no real use for it when I packaged it, I'm more than happy to have it now. It comes with the following features: Have a look at the examples in /usr/share/doc/python-application/examples to see how simple common things become if you use python-application for them, or just read trough the code, it's well commented and easy to understand.

Next.

Previous.