Search Results: "miriam"

23 February 2007

Simon Richter: Threads

Miriam, coroutines have the same problem as threads, futures and all the other interesting concepts out there: they are perceived as a magic bullet when they are merely one tool in the great toolbox. Whether a tool is appropriate depends on the job. Postgres, for example, handles each connection in a separate process, which adds a lot of complexity to their internal structures as all concurrent accesses need to be handled properly. However, SQL's transaction and isolation semantics make a single-threaded implementation almost as hard to implement, so the correct answer was to use threads. The biggest problem with threads is data consistency, and this is where almost all negative examples originate: some variable was not declared volatile, some lock not held long enough, some set of locks taken in the wrong order. A rule of thumb should be: if your threads need to interact, then you should not be using threads. If you have to compute something which will take longer, it is absolutely fine to start a new thread, but then you will have to protect the inter-thread communication appropriately. What is appropriate depends on the problem again; in most cases it will be message queues which allow the other thread to handly the request when it is in a safe state. Coroutines come in at a point where "you should not be using threads", by essentially allowing me to write a producer-consumer model as if it were threaded, and then letting the compiler build a nonthreaded version from that. In the C++ world, most algorithms can not be combined directly because they are written as a consumer/producer loop and cannot be suspended -- coroutines will make that possible.

13 February 2007

Miriam Ruiz: Threads considered harmful (what about coroutines?)

In 2006, Edward A. Lee wrote The Problem With Threads (PDF), in which he observes that threads remove determinism and open the door to subtle yet deadly bugs. While the problems are maybe manageable on single core systems, threads on multicore systems are likely to magnify the problems out of control. According to Wikipedia, coroutines are “program components that generalize subroutines to allow multiple entry points and suspending and resuming of execution at certain locations”. Coroutines are well-suited for implementing more familiar program components such as cooperative tasks, iterators, infinite lists, and pipes. Coroutines are more generic than subroutines. The start of a coroutine is the first point of entry, and places within a coroutine following returns (yields) are subsequent points of entry. Coroutines are also a lot faster than processes or threads switch, since there is no OS kernel involvement for the operation. Even though coroutines are supported in some high-level languages, there doesn’t seem to be an standard implementation of them in C or C++. The first time I heard about coroutines were in Lua. Since then, I’ve been trying to find a good solution for using them in C. Simon Tatham proposes a way of implementing them with a combination of subroutines and macros, but I think that, even creative and clean, this is a dirty approach for real code. What about handling with errors in the code? I still have nightmares when I have some problem to debug in STL-based code. Cryptic, the least. Due to the limitations of standard C libraries, some authors have written their own libraries for coroutines:

8 February 2007

Miriam Ruiz: Problems when packaging games

I’ll try to summarize the problems I usually encounter when packaging a game for Debian: I’m sure I’m leaving lots of points out of this list, it doesn’t mean to be exhaustive in any way. Maybe I’ll remember more things later.

6 February 2007

Miriam Ruiz: About the NM process

There’s a huge problem with the educational system as we know it. It doesn’t teach people how to think, to be creative, or even to improve their knowledge. When a kid goes to school, the first thing they learn is that the answers they must give are not what they consider to be truth, but what they think the teachers want to hear. When you’re in high school, or at university, you have the inner feeling that you must behave, or else. I had personal problems with a teacher at university, and learnt that you’re helpless in that situation. The motto would be that if you want to finish university, you should take care about getting on with the teachers. The result are submissive citizens that won’t face authority even if they know they’re right, in order to avoid problems. One of the best things in Debian is that is revolutionary, belief-guided. People do what they feel they should do, according to their own beliefs, and mostly don’t care about having trouble with the “authority”. That’s something I really like a lot, and respect. Of course that is also the source of multiple fights and disagreements, but usually the result of those is a better solution that whatever could be achieved by an authority imposition from the power-handling people. I like the revolutionary face of Debian as much as I like the technical one, and wouldn’t like losing it. The NM process is Debian’s “university”. It’s the process in which new generations of developers will enter the project. Therefore, whatever is done with it will highly influence middle-term evolution of Debian. Of course, the NM process must assure that people becoming developers have enough technical skills, and also that they’re ideologically aligned with the Social Contract. Otherwise it wouldn’t make sense. What should be taken care about is that the NM process don’t filter side thinking, creativeness, confrontation with authority or the will to make a better world. I wouldn’t like an NM process that promoted the same submissive values that the educational system does.

1 February 2007

Miriam Ruiz: Trying JSON for config files

Defining a grammatical structure for configuration files is a bit of a headache. The most easy way to get something to work is probably using INI files, but they’re somehow very limited for setting up configurations that are not quite trivial. The next obvious file format to look at are probably XML files, which are extremelly powerful for defining data structures, and are really fashion. While this might probably be the best choice when programming in certain languages, like Java or C#, especially if you use editors that are XML-oriented, it might not be the best for me. I’ve also seen that some projects read their configuration from script-languages files, such as lua. This might be quite interesting if you also allow embedded functions in that language in your code, for defining event responses, macros, or conditional configurations. Some other projects define their own grammar, maybe using Flex lexical analyser and GNU bison. I’ve recently come across JSON, which is a lightweight data-interchange format that is defined from a subset of the object literal notation of JavaScript. It is text-based and easily readable by humans, and suitable for representing objects and other data structures. There are libraries for reading these kind of files from many languages, and even though it seems to be very oriented towards structured data transmission over network connections (serialization), it might be useful for describing the initial setup of a program. I plan to use json-c from C. Lets see what comes out from there.

24 January 2007

Miriam Ruiz: Burnout

According to Wikipedia: “Burnout is a psychological term for the experience of long-term exhaustion and diminished interest (depersonalisation or cynicism), usually in the work context. Burnout is often construed as the result of a period of expending too much effort at work while having too little recovery, but it is sometimes argued that workers with particular personality traits (especially neuroticism) are more prone to experiencing burnout.” In this web page there’s a global overview of burnout that might be useful: Burnout is a chronic condition that happens when your body or mind can no longer cope with overwhelmingly high demands. You are trapped in a state of emotional exhaustion, and it is hard to get out of that state. You stop caring about what you do, even though you may feel guilty about that fact. Even if you still continue working, it seems to be hard to make progress. You hardly accomplish anything significant, just go through the motions. Certain categories of people and professions are particularly susceptible to job burnout. Most often these are people who are highly committed and motivated, who have high standards and idealistic dedication to their jobs. Common burnout causes include: For all of those burnout causes what is important is not as much the external factors that fall on you, but how you interpret them, what you say to yourself, and what actions you take in response. Finally, it is important to understand the risks of burnout in your personal or job situations. Once you are its victim, it may not be easy to get things back on track. That condition does not go away in a day. You may not be able to recover by yourself, and you may need to have drastic changes in your attitudes and life style. You are much better off preventing it now than putting your life back together later. Some links:

19 January 2007

Miriam Ruiz: Backtrace

I found a really nice way to trace back the execution stack inside a program, without the need of a debugger like gdb. I’ve made some test code in C that seems to work all right in my system. I doubt if it will just work in i386 systems, but it’ll do perfect for the debugging of the code I’m currently doing. It’s great.

Miriam Ruiz: More about my analysis of usplash

After my post from yesterday, I’ve been able to find out what my problem with usplash is about, although I’m stiill working in a proper solution to it. It seems that when the root filesystem is changed, programs must react accordingly. The proposed sequence for the usage of pivot_root is something like the following: To be able to analyze the exact starting sequence of the system stored in the initrd.img, we must expand its contents to a directory using cpio. Some time ago, initrd.img used to be a filesystem that used cramfs, minix or ext2 filesystems, but not anymore for the newer Debian systems. The script that is responsible for setting up the system at start is called init and is currently a shell program. Having a look at it, I found out that a temporarily environment variable is set, designing the place in which the real root filesystem will be temporarily mounted before switching it to the root filesystem: rootmnt=/root At some point later, /sys and /proc filesystems, that were mounted in their respective directories at the beginning, are moved to $ rootmnt /sys and $ rootmnt /proc to be set in their final destination directories: mount -n -o move /sys $ rootmnt /sys, and later mount -n -o move /proc $ rootmnt /proc At the end of the script, the system switches to the real root filesystem: exec run-init $ rootmnt $ init “$@” $ rootmnt /dev/console >$ rootmnt /dev/console I’ve changed my code so that /proc/… files I used are open from the very beginning, and kept open until the end of the execution of usplash, and it seems to work. I’ve also been able to write a debug log for it, storing it in /dev/.initramfs/, which is a directory that is kept in that place all the time, so that whatever is stored there is available after the soot switch. That is the directory that usplash uses to store its FIFO nodes: usplash_fifo and usplash_outfifo. Maybe I can find a way to store core files there after a SEGFAULT error, setting the proper parameters with ulimit and /proc/sys/kernel/core_pattern. All I need to find out now is how to be able to reach the contents of /etc/… after the final rootsystem is mounted. I’ll tell you when I’ve solved that.

18 January 2007

Miriam Ruiz: Experiments with usplash themes

I’ve been doing some usplash-related stuff these days, but I’ve come across some problems. First of all, I want to be able to track some hardware information from within the experimental theme I’m working on, and that means reading some stuff from /proc and /etc (and maybe from /sys in the future, I don’t know yet) if it is available. It seems to work OK if I open the file handler from the beginning and keep it open, rewinding to the start of the file when I need to read its contents but never closing it until the end of execution. If I instead open the file, read from it and close it again, it seems to work properly for the beginning, but after a while it stops retrieving data. I guess that when the real root is mounted i lose the capacity to interact with the filesystem from my code, like opening new files. The second problem is somehow related. I want to be able to save a log file of the execution of the program, but I don’t seem to be able to open a file for writing, at any moment in the execution of the program. I guess it’s the same problem, accessing the filesystem from a program that is started from initrd.img instead of from the real disk. Is there any way to connect the program with gdb during real execution? I seem to be getting SEGFAULT errors with some things I try, but it’s hard to debug without any data (not even logs, as I cannot open a file for writing at any moment). Maybe being able to dump a core when a SIGSEGV signal is received would do. More on this, in future posts.

16 January 2007

Miriam Ruiz: I might not be able to go to DebConf7

I sent an email to my boss a couple of weeks ago, asking for some days in June to be able to go to DebConf7. I wanted to buy the plane tickets as soon as I could, to be able to get a lower price. Last year they weren’t very happy about us having our holidays whenever we wanted, so this year they’ll probably decide that we must take them in August, whether we want or not. They’re having a meeting one of these days, if they find some time to do it, to discuss about that stuff, so I might find out soon whether I’ll be able to go or not. Or maybe I won’t be able to know until some days before, who knows. I was very happy about going to EDI this year, so if I cannot go, and if the perspective is that I’ll never be able to go to a DebConf again, unless they’re in August, I might need to start thinking about finding a solution, even when it might be quite drastic. I’ll keep you informed.

15 January 2007

Miriam Ruiz: Playing with usplash

I’ve been experimenting with usplash for some weeks, and it seems quite powerful. I decided to try with the latest version of the program (0.4), from Ubuntu’s repositories, which doesn’t seem to be backwards-compatible with the one that is currently in Debian (that is, 0.3e). The main idea of a theme in usplash seems to be embedding all the needed information into a shared object, including the images and the fonts, and coding the themes in plain C. This, which might seem terribly scary for non-coders, gives a lot of freedom for creating new effects in a certain theme, which is something I want to experiment. The low-level graphical fuctions use bogl (Ben’s Own Graphics Library) and svgalib for showing, and the rest of the code is built above them. Even though I like the overall design of the project, it doesn’t really suits my needs for what I want to try. I need to implement more low-level functions for certain effects, and I’m also considering doing some changes to optimize memory used. Right now I’m doing the graphical effects in a pixmap and, right at the end, dumping that pixmap onto the real screen, which makes me adapt what I want to the canonical code of usplash, but I guess at some point I might need to make deeper changes in the code, and I might need to change the insides of usplash.
I don’t know if something useful can come out of this, or if the results will be only aesthetic, but I’ll put my code available somewhere as soon as it is ready for inspection, so I can get some comments on it. As always, ideas are welcome.

11 January 2007

Miriam Ruiz: Connecting my MIDI keyboard to the laptop

Laptops don’t usually have as much ports as desktop computers. I used to connect my MIDI keyboard to the computer via a game port adapter. Now the game port has been to some extent replaced by USB connectors, especially in laptop computers, so I decided to get myself a MIDI-USB adapter. After searching the web investigating which device would be the best for my Debian system, I decided for the MidiSport Uno, which is elegant, compact, and compatible with Linux. Yesterday I was finally able to test it, and it works perfectly. The only thing I don’t like is that its firmware doesn’t seem to have a free license. After some initial trials with fxload, which didn’t work due to some pipe error, I realized that it wouldn’t work under the current udev system (I’m using a 2.6.18 kernel right now), but the rule for udev I added seems to work. Ubuntu’s package for it has also helped me a lot. After installing it, I was able to test that it worked both with a direct cat from the MIDI device and using rosegarden. There seems to be also an OSS driver supporting the MidiSport 1×1/2×2 with a GPL’d firmware, but I haven’t tried it yet. It would be nice to be able to have a GPL’d firmware in it.

10 January 2007

Miriam Ruiz: A cute toy

One of the most typical religious traditions in Spain, within the Xmas celebrations, is the Kings’ day (”D a de Reyes”), which is celebrated every year on the 6th of January remembering the arrival of the three Kings to bring their presents to baby Jesus. It is quite typical to have presents that day, and one of the things I got this year was an external 2.5′’ HD case with multimedia playing capacity. I also got a 120 Gb 2.5′’ HD for it. The strongest point I had for it was that my brother already has one and it seems to support many file formats and codecs without problem. In my very short experience with it, just a few days for the moment, it has been able to reproduce all the films I have tried. The main drawback is that it only supports VFAT/FAT32 and NTFS partitions, and only 2 different partitions, no more. Thus, I had to cope with NTFS if I wanted to use the whole HD. I created one VFAT partition as big as supported by that filesystem (32 Gb, with a file limit of 4 Gb) just in case I need it when I go to some friends’ house, and another NTFS partition for the rest of the disk. The next point was to be able to read and write to it from my Debian-powered computer. Reading NTFS is no problem at all, as it seems to be built-in in the kernel by default, but for being able to write on it, I had to use ntfs-3g. It seems to work perfect for me, on an Intel-compatible 32bit computer.

6 January 2007

Andrew Pollock: [life] Trip to Spain

(continuing with clearing the blogging backlog) Four days after returning home to the US from the trip to Australia, I was at it again, flying the other way around the world. In hindsight, this was totally insane, but I'd expressed interest in going much earlier in the year, I think before we'd organised to visit Australia. I flew to Madrid, via Philadelphia. I've said it before, but I'll say it again, Philadelphia International is a very nice airport. It's the first time I've flown across the United States, and it really is a long way. Just like Brisbane to Perth, it's a long time on a plane for staying in the same country. Arriving in Madrid, entering the country was extremely straightforward, as I've also said previously, the immigration guy barely looked at my passport long enough to open it and find a page to stamp. It was my first time in a country that didn't speak English and wasn't terribly bilingual. Fortunately the airport was signed in English as well as Spanish, and the information/assistance people all seemed to be able to speak English. I arrived in Terminal 1, and the European contingent were mostly arriving at Terminal 4, which is essentially a completely separate airport, a short shuttle bus ride away. My flight arrived in the morning, and I had about 4 or 5 hours to kill before the first of the European contingent rocked up. It was tempting to get a train or taxi into Madrid and have a bit of an explore, but I really didn't want to risk not getting back in time, so I just loitered around Terminal 4 for the time. The highlight of the waiting was I bumped into Doug Foster, who I used to work with a SecureNet in Canberra, disembarking a flight from London (where he's now working). It really is a small world. After everyone turned up, we got on a bus and headed for Badajoz, a mere 5 hour bus ride away. We didn't get away until about 7pm, so by the time we hit the road, it was dark, so there wasn't a lot to see. We arrived at Badajoz around midnight, and made a short walk to the hotel and had a late dinner and hit the sack. Unfortunately with all my travelling in the three weeks, I'd managed to come down with a cold, which started manifesting itself pretty much from the moment I got to Badajoz, so I started to feel increasingly suboptimal as the week wore on. Badajoz itself is an incredible little city. It's just like what I envisaged an old European city to be: narrow winding streets. It had a funny effect on me. I'd alternate between finding it really quaint, and incredibly claustrophobic (and I'm not usually the claustrophobic type). After doing a bit of self-analysis, I think the problem was the lack of sky. With so many buildings crammed in together and the narrow streets, the amount of sky you got to see was minimal. Definitely no horizon. I felt more comfortable at night, in fact the place looked really awesome at night. Everything was lit up, I think especially so for Christmas, and everyone came out and walked around and did shopping. The other thing that, well, I noticed about the city was that it was wall to wall concrete (or bricks, or bitumen). The buildings all connected up, there were no gaps between them, and the sidewalk basically ran from the front edge of the building, to the kerb, then there was the road, and then the reverse, so it was a real concrete jungle. That said, it was pretty clean. the sidewalks were all swept, there was no rubbish in the gutters. By about the second day, my cold had driven me crazy (my nose was running incessantly) and I just wanted some pseudoephedrine to dry it up. I didn't have a clue how pharmacies operated, but fortunately I was able to get Miriam to tag along with me, who spoke English as well as Spanish. She'd never heard of pseudoephedrine before, but as soon as she said it to the pharmacist, he knew what it was and came back with some form of Nurofen (ibuprofen) that also had pseudoephedrine in it. I didn't really want or need the ibuprofen, but when sick in Spain, beggars can't be choosers, so I took it. I didn't feel that it did a great deal for me anyway. Getting home again was fun. Due to various peoples' flights, the bus was leaving at 6:30am, and that wouldn't get me back to Madrid the ideal 3 hours before departure, so I took a taxi with a few people who needed to be there earlier. It left Badajoz at midnight, and arrived at Madrid at about 4am, where I had to wait for about 5 hours before I could check in for my flight. I had a bit of fun leaving, which I've already written about, and was happy to get home late on Sunday night. My cold had gone to my chest by this stage and I had bronchitis, so I was just glad to get home and see a doctor on Monday. So now I can say I've been to Europe. It was a shame I didn't get to see Madrid itself. Next time. Update Photos from the trip are here

19 April 2006

Simon Richter: Madrid or Babylon?

Yesterday we went for some Japanese food, and while Amaya and Miriam were talking in Spanish, Franzi and Jonas spoke German and I was thinking of some English sentence, one of the waiters made a remark in Japanese. That was where I lost track.

14 April 2006

Amaya Rodrigo: English Muffins

During the weekend, while I was in Mallorca, Joey Hess wrote an email to me in quite a hurry, he was coming to one of the Extremadura Sessions and needed a place to sleep at in Madrid. So, of course, due to my legendary hospitality, I happily accepted having him over. Franzi, Simon Richter s GF joined us, and so did tbm, who we had not welcomed to Spain yet. We set up a nice little dinner in order to properly celebrate Joey s 30th Birthday. OMG, I am also older than Joey Hess! Bummer.

I just asked him to bring some English Muffins, I got the standard answer:
> Please bring English muffins with you :)
You like (American) English muffins? :-)


Same as Erinn told me on IRC when I asked her to bring some to Mexico in exchange for vegan Allioli.
<Amaya> helix: english muffins!
<helix> Amaya: I don t think US english muffins are any good, but I could be wrong


WTF is wrong with English Muffins? They are my favourite breakfast, but I must acknowledge that not having an oven to slightly roast them into sucks :(

Anyway, I will take a bus really early in the morning tomorrow to join the Extremadura crowd. And I will start a little Staying at Amaya s HOWTO . It has been Holger, Miriam, Mooch, Hanna, Tuukka, Lars, Joey Hess, Franzi and Simon so far since I rented this small, run down attic that I call $HOME. That s less than a year :)

29 November 2005

Lars Wirzenius: Travel report: Quest for Sun '05 (Madrid)

Sun! Sunlight is a wonderful thing. Yesterday I came back from a six day vacation in Madrid. The weather was not warm, a bit warmer than in Finland, but especially it was dry and sunny. Pretty good autumn weather, actually. The best week I've had for a while. This was my Quest for Sun '05. I stayed at Amaya's place, slept well and long every night, had a wonderful time with some Debian people, and walked outside and visited a couple of wonderful art museums. Thank you, especially, Amaya, Holger, and Miriam. And also vi and emacs, the feline foot fetishists who rule Amaya's apartment. I took some pictures. They're touristy snapshots, not meant to be art. I meant to make notes about my experiences during the week, but the nice, classy Moleskine notebook I bought especially for the trip got lost the first full day. Some moments stuck into my mind, however. Since the Quest for Sun '05 was a success, I definitely will do it again. A week of light (and sleeping properly) really improved my mood. Maybe even enough that I will be able to deal with the remaining months of dark, gloom, wet, and cold of the winter in Helsinki. The only big negative thing about this trip was flying. I suggest that international air travel henceforth shall be called "The Cattle Drive".

Next.

Previous.