Monday, September 25, 2006

Java tops the list of popular languages!
This site here has come up with a survey of the most popular languages and Java is at the top!

Have a look at this site here.

Wednesday, September 20, 2006

ps on Linux displaying multiple instances of a process...
I was facing a question from a customer regarding ps showing multiple instances of the process which they mistook as to be multiple processes spawned over the 16 processors on the box by the primary process. I have posted a question on regarding this long time back but have not got any reply on this. Have a look at it here.

There were several things that I figured out on my own.

1. Linux treats threads as processes. There is no concept of thread in the Linux kernel.

2. ps command has a flag '-m' which shows threads spawned by the process. But ps on some kernel versions displays threads by default. When -m option is specified for ps on those kernel versions, ps gives out a message that 'thread display not implemented'.

Any more explanations are welcome.

Tuesday, September 19, 2006

Gokul On Storage!

This picture explains my friends noble intentions of writing a blog on Storage...

Have a look at his blog here.

Thursday, September 14, 2006

Hans Adventures!

The team here in Pune had a company trip to Hans Adventures, somewhere in the lush green areas of Konkan, on Friday 8th to Saturday 9th September 2006. It was a great trip at the right time. I was very frustrated and this trip just energized me. This place was just heaven with a very scenic drive to offer. Its about 105 kms from Pune towards Mulshi. I had great fun on this trip. We played football in the swimming pool! Some adventures offered here include river crossing and white water rafting. We did river crossing but missed out on water rafting :(. I have some snaps of the trip to share. Have a look.

Visit here for more info on this place

Wednesday, September 13, 2006

Sun StorageTek Business Analytics Wins!!!
Yesterday, Byte And Switch announced Sun StorageTek Business Analytics as the award winner in the category 'Storage Management Software'. Other competing products were Brocade Tapestry File Lifecycle Manager and Kazeon Information Server IS1200. Have a look here:

For more details on awards visit the Byte And Switch site here and for Finalists visit here

Tuesday, September 05, 2006

Linux fails to check bounds...

While I was testing a program for limiting its data segment size on a Linux box, I found something very strange. I specified the limit to the data segment size for my process by 'ulimit -d '. But to my surprise the program's behaviour was very weird, it kept on running without any problems whereas it should have failed at some point. I tried this small test wherein I typed the following commands to see if bound checking is actually done. I did this on both Linux and Solaris machines and the output is as follows:

> ulimit -d 1
> ls -la

This seems to run fine and display contents of the directory.

> ulimit -d 1
> ls -la

This did not work. 'ls -la' gave out an error, "Not enough memory".

This means that the limits set through ulimit have no effect so to say on Linux. This site has more details on why such behaviour:
Finding idle CPU cycles to utilize them.

I was finding out a way to detect idle CPU cycles to process something, so that my process does not hog up the CPU. Additionally I was trying to do this on a Linux box. After a lot of searching(googling) here and there, I found a link on Google Groups that said using nice 19 to set a processes priority to the minimum would only schedule the process when the CPU is idle. Here is the link

But this was not something I was looking for. I wanted a way to do it through my program. And voila! I found an API call that sets priority of a process. Its call setpriority(). Its very simple to use. And guess what I even experimented with it to confirm it actually works...

What I did was wrote a generic program that takes the priority as an argument and starts the process with that priority. Needless to mention, this API fails to change priority if the user spawning the process is not root. I started three processes with priorities -20, 0 and +19 which translate to high, medium and low priorities respectively. I observed the behavior of the three processes using top command and what I observed was that the process that had highest priority hogged up CPU to the maximum extent and so on with the one with least priority with very less CPU utilisation. But there is still something that I keep thinking. Is it accurate? Because doesn't detecting that the CPU is idle require some CPU cycles by itself?