Saturday, December 24, 2005

Philosophical differences btn Linux and Windows

A year ago when I was interviewing at Google, and the interviewer (hard core systems type) had finished grilling me about some of the guts of a kernel sub-system, I casually mentioned, that at that level Windows is probably not much different from Linux.

He said that he indeed sees philosophical differences btn the two operating systems even at that level.

A year later, a little wiser, I now ponder about that (I'm now working in a start-up in a Linux environment) and I see these similarities.

The most recent difference I encountered is the nature of file locking. In Windows, locking is mandatory - if a process takes a file lock, no other process will be able to access that file, until the first process gives up the lock. In Linux, the locking by default is advisory - another process can go ahead and access the file still! Only a "well behaved process" that tries to take the same lock before accessing the file, will be blocked until the first process gives up the lock.

At first, I was shocked - in fact somewhat disappointed in Linux which I'd grown to love each day. This actually meant that as a developer of a large distributed system, I had no guarantee that the file on which I have taken a lock is not being mucked around by say the Unix cp program.

So I started coding the locking, reading file stuff up and as I was debugging it discovered something quite pleasant. My program being debugged was modifying the file (after taking a lock) but it was still possible to use 'cat' from another shell to examine the contents of the file.

I realized that in my program, if things went wrong and a file got locked and the lock never got released, an admin can still go ahead and remove the file from the system - no reboots necessary. On the other hand, on Windows this is somewhat more complicated as the operating system can disallow the operation on a locked file.

This shows the protective nature of Windows that allows for some predictability by giving up on flexibility. Linux takes the opposite strategy.


Thursday, December 15, 2005

From napalm to white phosphoros

The US military now admits it used white phosphoros against Iraqis.
Since chemical weapon usage is banned in warfare, they have come up
with the notion that "white phosphorous is not a chemical weapon".

http://www.timesonline.co.uk/article/0,,7374-1875728,00.html

Note how CIA mentions white phosphorous being a chemical weapon when
Saddam Hussein used it against Kurds in 1991.
http://thinkprogress.org/2005/11/21/phosphorus-chemical/

So, the definition can be changed depending on who uses it, it seems.

White phosphorous (like napalm) sticks to the skin and can burn the
flesh to the bone. It is used as an extreme terror tactic in war. An
excerpt from http://blogs.washingtonpost.com/earlywarning/2005/11/trying_the_hole.html:


On November 8, Rainews 24, an Italian satellite news channel of state
controlled RAI, aired a 20 minute documentary Fallujah: The Hidden
Massacre, reporting on the assault of Fallujah in November 2004. A
former American soldier, Army Specialist Jeff Englehart, is quoted
saying that white phosphorus was used intentionally to attack
civilians. Englehart says he "saw the burned bodies of women and
children," some melted "right down to the bone." He is quoted as
saying that he "heard the order to be careful because white phosphorus
was being used."

The documentary shows close-ups of Fallujah civilians, badly burnt,
their skin dissolved or caramelized. An Iraqi biologist in Fallujah is
interviewed, saying "a rain of fire fell on the city," burning
people's flesh, but strangely leaving "their clothes intact."