Wednesday, July 9, 2008

Now *that's* debugging

Occasionally, you only fix one bug a day. But, you have a good story to tell.

Several notes:
"One of the goals of the operating system's designers is to not allow programs running in user space to ever crash the entire machine."
Yep, yep.

Any misbehaving application can turn into the equivalent of a Fork bomb, exhausting some OS resource. (Fork bombs gobble up the number of processes that are available on a machine, but a bad application can gobble up pretty much anything - CPU time, memory, overload the disk with seek requests, etc.)

The more blocks and checks they put between us and the hardware, the slower our programs are going to run.
Yes, in theory. In practice, you are not going to notice if the OS takes a couple of clock cycles to check that your application is not doing something crazy. That's kinda the point of an OS - to abstract you away from the hardware, and to make your application play well with others.

This is like complaining that the side mirrors on your car are impacting the top speed. (True, if you are trying to set a land speed record. Not true if you are commuting.)

Imagine if the Apple said to programmers: "Ok, in order to not let you dominate the hardware, we will only let you use 50% of the CPU at any one time." Now imagine you're a user, running World of Warcraft on your brand-new $4,000 ultra-lux machine, and you're only getting half the framerate you
should be, and would be under, say, Windows.
The 50% figure is a bit silly. But yes, making a 'bulletproof' OS for consumers with a lot of protections against resource exhaustion is, in my opinion, generally not worth the effort - your average user does not run into this fork bomb issue all that much, and it is generally recoverable.

Avie Tevanian had been working on Mach as a PhD student at Carnegie Mellon, and Steve Jobs recognized he was a star and hired him straight away. (Microsoft countered by hiring Avie's old advisor to work on NT, which is kind of like Microsoft hiring my mom because I'm a good programmer.)
Ad hominem, for no good reason.

Knowing it was an immutable data, the CoreData object didn't make a copy of my data, it just retained the exact same NSData object. The one that had an open memory-map of the image file!
Excuse me for smirking, but this occasional does-the-OS-have-a-pointer-to-that-bit-of-memory head scratching is something you have to do in the Win32 world as well. The horrible, much maligned Win32 world. The more things change...

12 comments:

Rick said...

Thanks for the link. It was a good read.

Unknown said...

Soma, please read this blog post that I ran across:

http://www.andrew-turnbull.net/tech/windows95.html

and take note of the points to why this user still uses the classic Windows 95 OSR2 as his default system while developing Windows "7".

I enjoyed reading his blog post, as it has many of the common sense things a user looks to: works like a charm stablility, and does what it needs to do (and perhaps sometimes more, as in the extra features).

Looking at using Windows 95 as a common user of XP, I would see no reason for running it (its pretty erratic and unpredictable in my opinion). But, reading this blog post, I realized: all I need is for the basic features to work and be unobtrusive AND I need the extras to NOT interfer that greatly with the basics.

For example, his point on the 98 integration with IE4/IE5 is correct: it is needlessly complicated and too embedded into the operating code. And the flashy "eye candy" future Windows OSes has become completely obtrusive. Sure looks nice and all, but the extra eye candy and features associated with it (like Aero) decreases performance by A LOT. Thank god you guys still include the Windows Classic theme!! Besides that, compatibility and stability is a must in an OS, so it lessens the problems the end user runs into and increases satisfaction.

Overall, I just wish the developers would please lessen the hardware requirements in the Windows "7" project (which, I think, is the main downfall for Vista, I mean, the extra features are pretty nice to have...). Vista has now become more stable and compatible with many things, and I hope "7" carries it on. However, I wish "7" to be more efficient and speedy in running programs, and especially with the themes and stuff. I want the "eye candy" to just be there and have no noticible performance losses (come on guys, my great XP PC would run Vista horribly because of how it eats up RAM). Besides that, the basic features should and must be there, working flawlessly, and the extras integrated in such a way that it doesn't intrude on any of that basics. I hope that means Paint and Notepad may finally get some necessary upgrades, while not completely changing the look and feel of the programs. ;)

Thanks for your time, Soma. Yeah, the blogger at http://www.andrew-turnbull.net/tech/windows95.html has great points. I truly wish for project "7" to carry on these points: stability, performance, and compatibility. I wish for the developers to optimize the 7/Vista code (which, to my understanding, is built upon for 7, correct?), make it more efficient, and continue doing so even after RTM release. Features must fit together nicely, and feel natural in a program and the OS itself. That applys to the default programs an OS is shipped with AND the "look and feel". (Also, can I ask for the developers to improve upon the Windows maintenance utilities, like the defragmenter and cleaner? Nothing significant to be called a competitive monopoly, but significant enough let the end user keep his/her system running smoothly.)

Thank you very much for listening. I highly appreciate it, and I love to read your blog posts. I hope you take the http://www.andrew-turnbull.net/tech/windows95.html blog post and my points into consideration while developing 7. Once again, thank you very much :) !!

Unknown said...

Check this out also: about UI designs (especially Office Assistant, which I personally didn't hate, but others did):

http://xenon.stanford.edu/~lswartz/paperclip/

--> Pretty long article, but well thought out. I found it interesting. Maybe the design team can take a quick peek?

lx said...

@Stanley:
"Sure looks nice and all, but the extra eye candy and features associated with it (like Aero) decreases performance by A LOT."

But, they increase usability by a lot.
And since Aero renders the graphics via your (otherwise "idling" (?)) graphics processor I wonder, just exactly how much performance impact the new UI has.
Anyway: I work much faster with Vista since it's much more convenient to use than older versions of Windows...

You can't really measure an UI just in terms of "oh noes, but windows 98 renders 100ms faster!".
Imho Vistas new UI features (let aside Flip3D.. a completely unnecessary feature..) are not only just eye candy, they boost work speed and usability by a lot.
For a every day use system that's (for me) much more important.. and.. new machines are fast enough that you don't notice any slow down while working with Vista ;)

< /rant >

Mahoney said...

I agree with lx. Vista is very fast for me. With every upgrade to Windows we've had a performance cut. It has gone up almost exponentially over the years. So, of course it will be a bigger jump than 2000 to XP, or 98 to 2000, and so on. But, we must remember Moore's law. Computers today can run Vista fabulously. So, you can't shoot down an OS because your XP machine doesn't run it well, because it's just that: an XP machine.

So, I understand not upgrading an older machine. It is slow on older computers. But, that's not a reason to drop it completely.

@lx
"oh noes, but windows 98 renders 100ms faster!"

Kudos on that. :)

scsi said...

There's no need for 43423792 checks to stop misbehaving applications. There's a program used to stop CPU monopolization. It's called a scheduler.

Ashok yadav said...

MAG Studios is a leading software development & web development company offering ecommerce web site development, search
engine friendly web development, customized software development services india delhi.
Software Development | SEO Services India | Website Design India |
Content Management System (cms) | Customer Relationship Management (CRM) | BPO India
Intranet Portal

Anonymous said...

testbegin We always convince ourselves that life will be better after we get married, have a baby, than another. Then we are frustrated that the kids aren't old enough and we'll be more contet when they are. After that we're frustrated that we have teenagers to deal with. we will certainly be happy when they are out of that stage.

We always tell ourselves that our life will be complete when our spouse gets his or her act together. when we get a nice car, and are able to go on a nice vocation when we retire. The truth is, there's no better time than right now. If not now, when? our life will always be filled with challenges. It's best to admit this to ourselves and decide to be happy anyway.

One of my favorite quotes comes from Alfred Souza. He said."for a long time it had seemed to me that life was about to begin-real life. But there was always some obstacle in the way, someting to be gotten through firest, some unfinished business, time still to be served, a debt to be paid.

Then life would begin. At last it dawned on me that these obstacles were my life." This perspective has helped me to see that there is no way to happiness. Happiness is the way. So treasure every moment that you have.

And remember that time waits for no one. So stop waiting until you finish school, until you go back to school; until you get married, until you get divorced; until you have kids; until you retire; until you get a new car or home; until spring; until you are born again to decide that there is no better time than right now to be happy….

Happiness is a journey, not a destination.So, work like you don't need money, love like you've never been hurt, And dance like no one's watching. testend

Anonymous said...

testbegin We always convince ourselves that life will be better after we get married, have a baby, than another. Then we are frustrated that the kids aren't old enough and we'll be more contet when they are. After that we're frustrated that we have teenagers to deal with. we will certainly be happy when they are out of that stage.

We always tell ourselves that our life will be complete when our spouse gets his or her act together. when we get a nice car, and are able to go on a nice vocation when we retire. The truth is, there's no better time than right now. If not now, when? our life will always be filled with challenges. It's best to admit this to ourselves and decide to be happy anyway.

One of my favorite quotes comes from Alfred Souza. He said."for a long time it had seemed to me that life was about to begin-real life. But there was always some obstacle in the way, someting to be gotten through firest, some unfinished business, time still to be served, a debt to be paid.

Then life would begin. At last it dawned on me that these obstacles were my life." This perspective has helped me to see that there is no way to happiness. Happiness is the way. So treasure every moment that you have.

And remember that time waits for no one. So stop waiting until you finish school, until you go back to school; until you get married, until you get divorced; until you have kids; until you retire; until you get a new car or home; until spring; until you are born again to decide that there is no better time than right now to be happy….

Happiness is a journey, not a destination.So, work like you don't need money, love like you've never been hurt, And dance like no one's watching. testend

Anonymous said...

testbegin We always convince ourselves that life will be better after we get married, have a baby, than another. Then we are frustrated that the kids aren't old enough and we'll be more contet when they are. After that we're frustrated that we have teenagers to deal with. we will certainly be happy when they are out of that stage.

We always tell ourselves that our life will be complete when our spouse gets his or her act together. when we get a nice car, and are able to go on a nice vocation when we retire. The truth is, there's no better time than right now. If not now, when? our life will always be filled with challenges. It's best to admit this to ourselves and decide to be happy anyway.

One of my favorite quotes comes from Alfred Souza. He said."for a long time it had seemed to me that life was about to begin-real life. But there was always some obstacle in the way, someting to be gotten through firest, some unfinished business, time still to be served, a debt to be paid.

Then life would begin. At last it dawned on me that these obstacles were my life." This perspective has helped me to see that there is no way to happiness. Happiness is the way. So treasure every moment that you have.

And remember that time waits for no one. So stop waiting until you finish school, until you go back to school; until you get married, until you get divorced; until you have kids; until you retire; until you get a new car or home; until spring; until you are born again to decide that there is no better time than right now to be happy….

Happiness is a journey, not a destination.So, work like you don't need money, love like you've never been hurt, And dance like no one's watching. testend

Anonymous said...

testbegin We always convince ourselves that life will be better after we get married, have a baby, than another. Then we are frustrated that the kids aren't old enough and we'll be more contet when they are. After that we're frustrated that we have teenagers to deal with. we will certainly be happy when they are out of that stage.

We always tell ourselves that our life will be complete when our spouse gets his or her act together. when we get a nice car, and are able to go on a nice vocation when we retire. The truth is, there's no better time than right now. If not now, when? our life will always be filled with challenges. It's best to admit this to ourselves and decide to be happy anyway.

One of my favorite quotes comes from Alfred Souza. He said."for a long time it had seemed to me that life was about to begin-real life. But there was always some obstacle in the way, someting to be gotten through firest, some unfinished business, time still to be served, a debt to be paid.

Then life would begin. At last it dawned on me that these obstacles were my life." This perspective has helped me to see that there is no way to happiness. Happiness is the way. So treasure every moment that you have.

And remember that time waits for no one. So stop waiting until you finish school, until you go back to school; until you get married, until you get divorced; until you have kids; until you retire; until you get a new car or home; until spring; until you are born again to decide that there is no better time than right now to be happy….

Happiness is a journey, not a destination.So, work like you don't need money, love like you've never been hurt, And dance like no one's watching. testend

Anonymous said...

testbegin We always convince ourselves that life will be better after we get married, have a baby, than another. Then we are frustrated that the kids aren't old enough and we'll be more contet when they are. After that we're frustrated that we have teenagers to deal with. we will certainly be happy when they are out of that stage.

We always tell ourselves that our life will be complete when our spouse gets his or her act together. when we get a nice car, and are able to go on a nice vocation when we retire. The truth is, there's no better time than right now. If not now, when? our life will always be filled with challenges. It's best to admit this to ourselves and decide to be happy anyway.

One of my favorite quotes comes from Alfred Souza. He said."for a long time it had seemed to me that life was about to begin-real life. But there was always some obstacle in the way, someting to be gotten through firest, some unfinished business, time still to be served, a debt to be paid.

Then life would begin. At last it dawned on me that these obstacles were my life." This perspective has helped me to see that there is no way to happiness. Happiness is the way. So treasure every moment that you have.

And remember that time waits for no one. So stop waiting until you finish school, until you go back to school; until you get married, until you get divorced; until you have kids; until you retire; until you get a new car or home; until spring; until you are born again to decide that there is no better time than right now to be happy….

Happiness is a journey, not a destination.So, work like you don't need money, love like you've never been hurt, And dance like no one's watching. testend