Sunday, November 18, 2007

Testing the Gibbon

For one of my college projects, I needed to test the performance of a network protocol named SCTP. To do that, I set up three different Linux machines. One to host the server, the second one to host a client and the last one to emulate the Internet. In my previous work I became familiar with Ubuntu, and seeing that it is so newbie-friendly, I continued to use it. So I installed Ubuntu in the project's machines. First it was Edgy, and then Feisty -yes, I have been working in this college project from two years ago-.

So far it was working perfectly, but there were issues in some of my last tests. Someone advised me that maybe the Internet simulator (using NetEm) needed 1000hz interrupts enabled in the kernel. And that the kernel 2.6.22 supported that. As Ubuntu 7.10 came with that kernel, I decided to upgrade the machines to this latest distro.

My main machine has a nice graphics card, so I installed its restricted drivers, and then Ubuntu enabled Compiz-Fusion. And oh boy it looks good! Loving the dock and Exposé of the Mac computer I use for my thesis, I installed a dock and configured Compiz to show windows like Exposé. Also a enabled the cube desktop (and set four viewports) and made it a bit transparent, to see all viewports at the same time. I spent several hours playing with all available options, until I reached a configuration that I liked.. and it's so beautiful! As I mentioned in another post, I am very happy with my customized XP box, but maybe Linux will become my main OS in the near future. Keep the good work!

Saturday, November 10, 2007

Transactional Collections

In my previous job, I was a Java developer and I was in a team that was building a Content Management System. Although there was a lot of exciting modules to work with, the ones I liked the most where a transactional map and a transactional file system.


The former was mostly used as a Cache system, where the transactional map was backed by a LRU map. We analyzed some of the Transactional Caches available in the moment, like JBossCache, but they were too much for what we needed, and in some cases they were buggy. In my opinion, once we finished it, it was an excellent map, better than the one offered by the Commons Transactions at that time. As a matter of fact, several times I thought joining the CT project to contribute by building different kind of transactional collections, like a set, sorted set, sorted map, a list, etc.

I thought about building a transactional sorted set or a list, and they seem more difficult as not only you have to keep the ACID properties for those objects added to the collection, but also keep their positions, and try to minimize the overhead.

Commons Transactions also offer a file system, but it doesn’t seem to comply with a XA interface - XAResource -. In my job both the map and the file system were managed by a JTA as they worked in conjunction with a database. Luckily, as the transactional map is a memory only collection, it isn’t necessary to keep a log and do some kind of recovery disaster in the case of a crash.

I wonder the status of transactional collections in other languages, like C++ or Smalltalk…

Friday, November 9, 2007

Arimaa

A few weeks ago, I started a Go entry course. I don't plan to become a Go player with a "Dan" level, just to know the basics and be able to defend myself. But today, while I was searching for a good Go computer program, I came across a game named Arimaa.

What I found interesting about this new game is that was made with the purpose of being difficult to build a competent computer A.I. for it. In its Wikipedia entry, they talk about Game Theory, Brute force search depth, and such. It is compared with chess as they both share a similar board.

They offer a prize for the one who can build a computer program capable of defeating human players, and without the need of a Deep Blue supercomputer. Seems like an interesting challenge.

On the other hand, it is also hard to build good Go programs, but at least there exist some of them. And I really like the ones made for cell phones as I can practice while I'm travelling.

Sunday, November 4, 2007

Filesystems

If I had to work in an OS, I'd choose to work in filesystems and I/O. I think there so much to improve in that department. I hate when there's a lot of I/O trashing and page swapping in Windows.

Sometimes I look for new stuff like the ZFS, or new methods of journalling and those dancing trees. They seem interesting. I SHOULD become part of some open source project involved with filesystems... but right now I don't have much free time to do that.

I'm looking forward to those new solid state disks (or at least hybrid disks). I wonder if there will be a new file system to use their advantages? Seems that the Wikipedia article about file systems has some info about this, and a link to Log-structured file system

I'll try to research about the new Transactional NTFS and see if it has some worth that isn't available in Linux.

Saturday, November 3, 2007

My Leopard non-news

Right now, where I'm doing my thesis research, I'm using a Mac to work. My professor is used to one, and as he gave me my computer, I learnt to use one to.

The Tiger was easy to learn, though a bit awkward at first, having the min/max/close buttons at the window's top left corner. And then knowing that applications have their files bundled together and installed into an applications folder, and discovering a good object dock and that marvellous thing called Exposé.

Some day later I read a way to install the x86 version of Tiger on a regular PC, and so it did. It worked like a charm (my PC had a Geforce video card and an Atlhon 64 with SSE3), and I played with it for a while. Then I got bored and deleted it deciding that if I should part from Windows some day, I'd go to Linux instead.

As a few days ago Leopard was released, I downloaded it (ehem) just to have a look at it and its new features. But I just got lazy, asking myself, why spend a lot of time reinstalling Tiger and then upgrading to Leopard (following several boring commands) when I will surely delete it some time afterwards? So I decided not to install it and have a look at Gutsy Gibbon instead when I can find some time.

And about those similarities between Mac OS X and Vista... well, I think it's ok to copy a feature from another OS if it's a good and useful one.

Sunday, October 28, 2007

My XPerience with Vista

People talk about this new Windows, they talk a lot. What I don't buy is people who talk about it without having tested it. I had Vista installed on my computer for a while, and I liked it. But then I went back to XP. Let's see the "pros and cons" I found in Vista.

New security model:
Besides the Access Control List security, a process can now run with three different privileges: High, Medium and Low. A process is run with high privileges if it was executed by the true administrator account or a system one. Limited users (including the new limited administrator account) run processes with medium privilege level, and optionally with low privilege. The "protected mode" of IE7 makes it run in low privilege.
Of course, a low privilege process isn't able to write into a folder that requires medium privileges, and, as usual, I read a blog where some guy explained how a process could get higher priveleges without the user knowing it, and why it was possible (That is, the model isn't perfect because of compatibility reasons).
UAC is as annoying as the "run as" context menu when you run XP with a limited user. You can make it less painful (and less secure) by turning off the "secure desktop", or more painful (and more secure) by turning on an option that requires you to press ctrl+alt+del before the elevation dialog.
What I don't like about UAC is that every program named "setup.exe" asks you for elevation. What if I want to install a program with my limited user without having to elevate? I hope they solve that.

I/O priority:
This should be a good thing. In XP, if some process starts doing a lot of I/O, the desktop crawls (more so if that I/O is related to swapping and pagination). Right now, only the disk defragmenter included with Vista uses a low priority I/O, and I think that Media Player uses high I/O.

Readyboost, SuperFetch, Large Cache:
To tell you the truth, I haven't seen a lot of difference in how fast processes start comparing Vista to XP. They are just a bit faster.

DRM:
I think it only affects DRM-enabled content. I don't know what's the deal with it. We should fight against DRM, not against Vista because of it.

No more Directsound 3D:
Enter XAudio? This is what I don't like about MS. They change the APIs too often.

Shadow Copy (Previous version), "Backup and Restore center" and "Complete PC Backup":
Besides the Recycle Bin and System Restore, you get three new backups (the last one in the Ultimate version), but the first one is useful as can make your file system "versionable". These are good things unless you are used to do your own backups (and I wonder if some antivirus deletes an infected file, then the shadow copy could bring it back to life?).

GPU Scheduling and DX10:
DX10 looks nice, but I think that those new features will be available in OpenGL as well. On the other hand, preemptive GPU scheduling and memory management seem like a really good idea that I haven't seen in any other OS that I'm aware of. And as it requires driver level changes, it can't be ported back to XP. So, if you have a DX10 capable GPU and want to run several 3d applications at the same time, Vista has an advantage here. I should also mention the Vista capability to reload the graphics driver if it crashes, instead of going into a blue screen.


UI, Aero and DWM:
I have to agree that Vista looks pretty, and requires more screen space. Messages errors, control panel organization and the help system are more oriented to people who doesn't know computer jargon. That's a good thing, although people coming from XP have to adapt to the new location of everything. With Aero and some programs I could made the Desktop look like a Mac.
Dreamscene was nice. The thing about using GPU instead of CPU I think it's ok. I wonder about power consumption and GPU life span though.

But, then again, I know about computers, and I am a developer. I realized that what I wanted was:

  1. Fast start-up, shutdown and fully functional sleep and hibernation.
  2. As little I/O as possible (responsiveness).
  3. A desktop focused to work.
So, what I did?
  • I made a bunch of partitions (for documents, for videos, for Windows..).
  • Then I reinstalled XP, and disabled every process I didn't use.
  • Later installed only those programs I really use to avoid registry bloat.
  • I disabled System Restore because, although it has a great purpose, I have never used it.
  • I made a ram disk with 512MB (My computer has 2GB of memory) and put the swap file on it (I never use that much of memory and Windows does move process to swap no matter how much memory you have).
And the conclusion is: Vista is good, but XP is better for tailoring to my needs.

I should tell that another reason to uninstall Vista is a political one: I dislike some choices made by Microsoft. I could also say that I could have gone to Linux, as I work primarily with Java, but that's another story.