Intel will never make the pentium virtualizable. That would require that they break backwards compatibility and produce a processor spec that is not a kludge wrapped within a kludge stuck in a 200 stage pipeline.
I'm not a fanboy for any processor. I don't build 'em or write assembly most of the time, but the x86 architecture is a mess.
#define should NEVER be used for anything except to protect headers from being included multiple times or to separate non-portable code. As mentioned, const variables and inline functions provide the exact same functionality and performance(on a good compiler), but also have type checking. If you don't want type checking, use an inline template.
Unions are the most useless feature of C++. I find void pointers easier to deal with in the rare circumstance that something like this is needed.
>"In C++, all parameters are passed by value." Unless they're passed by reference, anyways.
If you want to get technical about it, a pass by reference is equivalent to passing a pointer(reference) by value. Think about the syntax of the declaration.
>You do not need to use std::malloc to allocate a structure or a builtin type. The 'new' operator works just fine.
Even better, you should NEVER use malloc to allocate a structure or a builtin type in C++ unless you know exactly what you are doing. The structure may have a constructor that won't be called using malloc. Just a language lawyer note, but std::malloc should not be a resolvable name. std:: is for C++ libraries. malloc is a C function and will be in the root namespace, so fully qualified it is::malloc.
actually, no. Moore's law has been misquoted and misused in so many places it is a shame.
The cost is not factored in to moore's law. The law pertains to chips with the lowest per-component cost. It has nothing to do with the ratio of cost to transister count.
The real truth is that EVERY decision about a program needs to be made in the context of it's creation and deployment.
If your writing something like 'ls' that will run often on large multiuser systems, speed should the be ultimate goal.
Alternatively if you are writing something that will run once a week and will only be deployed on the two systems in your lab, ease of coding and maintainability should be the goal, since in this case it will probably be cheaper to throw more hardware at it than to pay a programmer (or use your own precious time) to spend the extra time on optimization.
It's all about context. Hardware is cheap if you only need one more box. Hardware is expensive if 10,000 users need to buy new boxes because your program runs slow. Programmer time is expensive if a single user is footing the bill, but if there are 10,000 users to amortize the cose, programmers become cheap.
The author also seems to think that choosing a programming language is part of the performance picture. It is to a small extent, but this must also be viewed in the cotext of the application. Different languages have different advantages and disadvantages. Some are slow for mathematical calculations but can push strings around incredibly fast. Some are really 'safe' when it comes to bounds checking. Some are easy to use and are fast when most calls are to libraries. Some are great for long-running processes, but thrash the drive on startup and are attrocious for short-lived programs.
I spent a summer doing just that. I was working with a group who had almost zero programming experience and just a little database experience. We made things work, but it took 3 quad-P3 servers to run the database (running about 80% capacity 24/8).
Since we were in the R&D wing, we threw the whole thing over to the operations people about the time I headed back to school.
The next semester in school I had a databases class. I was baffled by the lack of understanding we had of even basic database design.
Later I found out that a single operations guy did a complete rewrite of our code in about a week. He had all that useless math background and database experience. His version ran on a single server and was usually at only 50% load.
There are reasons to hire well trained and experienced programmers even for tasks that seem simple.
I realized this might be a point of contention and misunderstanding. I don't want to discount the importance of earlier grades, etc. However, the fact is that teachers at all level need teaching skills. These are important skills and also differ among the "grades" in our education system, but beyond those skills, the skills of teachers at lower levels are comparable to those of day-care workers. They need to be able to supervise and provide discipline for young children. They also need to impart knowledge, but this knowledge is at a low enough level that most high school graduates SHOULD be able to handle this. On the other hand as you advance up the ladder you need people who have more knowledge and less skill as disciplinarians.
I don't mean to degrade or demean elementary school teachers. My mother is an elementary school teacher and I know that I could never do her job, but I also know that she would not be a good teacher at the high school level or very marketable to companies not in the education or child care fields.
Actually, lots of people don't need to be paid more. The market sets salaries and people get paid for what they produce. However, teachers produce a public good, and are therefore paid by the government, which doesn't need to justify expenses and inflow the same way a company does.
We need GOOD teachers who know their field. Teacher salaries should not be compared to the job market as a whole, they should be compared to the salaries of workers who have a bachelor's degree or better.
When it comes to the welfare of our economy as a whole, teacher's really deserve to make much more than they would in industry. Someone who is great at teaching math or science can help produce hundreds of new workers who are good in that field. The contributions made by these new workers will be much greater than that teacher's contribution would have been if they had gone into industry.
Admittedly, being a great worker and being a great teacher are not mutually inclusive, but a teacher needs to have skills in their field.
As the article cited by the parent points out there are differences in different levels of the education system. I don't mean to offend anyone, but 1st-3rd grade teachers may be getting the salary they deserve at present. At that level, they are basically day care workers whose knowledge doesn't need to go beyond that of a high school graduate. However as you move later in the education process, the teachers need to be more and more knowledgeable to keep up the the material they are teaching.
The reason it wasn't a problem before that time was because intelligent women had zero opportunity elsewhere. They could teach, stay home, or get a menial manufacturing job.
His teachers do need to be paid more. Teachers make such crappy salaries, it's no wonder good ones are hard to come by. I would love to teach, but since I would have to work harder and get paid about one quarter of what I make with a real job, it just isn't practical.
I really doubt they are spending anywhere near this for the machines themselves. A former student a google employee made one of those recruiting/marketing visits to my university last semester. I got to speek to him at length about Google's operation. According to him (and he had pictures to back this up). All of their boxen are a motherboard, an ide drive and a processor sitting on a shelf in the rack. No cases, no fans, no cd, etc. Plus they buy in bulk and get good prices.
unless you're running a database, a web server, etc and the 'live' process isn't gonna use those pages for a little while. If it really is a 'live' process it won't get swapped out. If you mean 'interactive' process, then you get into the windows trap of optimizing everything for foreground processes and killing your ability to do real multitaking.
Particularly from the linux point of view, dbms/web server/etc performance should be a big issue. This is where linux thrives. And as was mentioned before, this is tunable for desktop users who want to keep the disk cache small because most pages are only needed once anyway.
Who thinks that writing a page to disk immediately wipes the ram it came from. This is how things really do work.
The problem is whether this paged but still valid ram should be given to other processes. I would say it is a tuning thing. There is no perfect method that will be best for all situations.
Whoever modded this insightful needs to do a little reading about operating systems.
personal preference in some cases. In some cases it is a difference of readability. In general for loops are meant for iteration and while loops are for condition checking.
I would say either would apply here.
However, for loops and while loops are identical in power. for(a;b;c){d;} is identical to a;while(b){c;d;}. Just rearranging stuff.
I would think that for loops are easier for a compiler to optimize in some cases, though.
I recently attended a talk from one of MS's "education evangelists" who go to universities to push Windows. The topic was high-performance and grid computing. I was shocked that he would even try this at a school that is devout about using linux and solaris for CS labs.
I almost laughed out loud when someone asked him what they do about having to run a window manager on every box in a cluster/tight grid environment.
His answer: Whenever they boot the boxes, they go to each one and set the priority of the windowing stuff as low as it will go.
How is it possible that a lab run by MS cannot build a version of the OS that doesn't require the window manager?
Apple doesn't scale because you can't put a large number of chips in the same box. x86 isn't as limited, but it's not great either.
As you add processors, there is a diminishing return on inverstment with each one. iow, two uniprocessor boxes will be able to do more work than one dual box, however they cannot operate on the same data at the same time (I know beowulf, etc. give me a break). In some cases, one box with n chips will outperform a box with n+1 chips.
On Sun hardware, this difference is less than on apple and x86 hardware.
Sun's architecture is designed from the ground up to have a bunch of processors in the same box. This is part of the reason that their uni boxen are unimpressive performance wise. Scalability sometimes hurts small scale performance(Think using Oracle/MySQL/PGSQL for a table with 100 rows. Sorting and binary search would be faster).
This is a good idea in theory. Almost all *n*x users do this (or at least the ones with decent administration skills).
However, I've run into several MS programs that have trouble with things like this. They'll store references to the registry in documents. Save files get put in the program directory. And the list goes on. It also becomes a huge hassle on single user Windows systems with more than one user, since there aren't any permissions.
I don't know about anyone else, but this sounds like a great way to have cheap offsite backups. Just email them to yourself@gmail.
And some programmers look down on people "in IT". I can't imagine why.
Intel will never make the pentium virtualizable. That would require that they break backwards compatibility and produce a processor spec that is not a kludge wrapped within a kludge stuck in a 200 stage pipeline.
I'm not a fanboy for any processor. I don't build 'em or write assembly most of the time, but the x86 architecture is a mess.
I agree with you on most point: to expand.
::malloc.
#define should NEVER be used for anything except to protect headers from being included multiple times or to separate non-portable code. As mentioned, const variables and inline functions provide the exact same functionality and performance(on a good compiler), but also have type checking. If you don't want type checking, use an inline template.
Unions are the most useless feature of C++. I find void pointers easier to deal with in the rare circumstance that something like this is needed.
>"In C++, all parameters are passed by value." Unless they're passed by reference, anyways.
If you want to get technical about it, a pass by reference is equivalent to passing a pointer(reference) by value. Think about the syntax of the declaration.
>You do not need to use std::malloc to allocate a structure or a builtin type. The 'new' operator works just fine.
Even better, you should NEVER use malloc to allocate a structure or a builtin type in C++ unless you know exactly what you are doing. The structure may have a constructor that won't be called using malloc. Just a language lawyer note, but std::malloc should not be a resolvable name. std:: is for C++ libraries. malloc is a C function and will be in the root namespace, so fully qualified it is
actually, no. Moore's law has been misquoted and misused in so many places it is a shame.
The cost is not factored in to moore's law. The law pertains to chips with the lowest per-component cost. It has nothing to do with the ratio of cost to transister count.
I think the article over-simplifies the issue.
The real truth is that EVERY decision about a program needs to be made in the context of it's creation and deployment.
If your writing something like 'ls' that will run often on large multiuser systems, speed should the be ultimate goal.
Alternatively if you are writing something that will run once a week and will only be deployed on the two systems in your lab, ease of coding and maintainability should be the goal, since in this case it will probably be cheaper to throw more hardware at it than to pay a programmer (or use your own precious time) to spend the extra time on optimization.
It's all about context. Hardware is cheap if you only need one more box. Hardware is expensive if 10,000 users need to buy new boxes because your program runs slow. Programmer time is expensive if a single user is footing the bill, but if there are 10,000 users to amortize the cose, programmers become cheap.
The author also seems to think that choosing a programming language is part of the performance picture. It is to a small extent, but this must also be viewed in the cotext of the application. Different languages have different advantages and disadvantages. Some are slow for mathematical calculations but can push strings around incredibly fast. Some are really 'safe' when it comes to bounds checking. Some are easy to use and are fast when most calls are to libraries. Some are great for long-running processes, but thrash the drive on startup and are attrocious for short-lived programs.
Tungsten C!!!
color
much brighter
better resolution
better battery life
built in wifi
the list goes on.
I spent a summer doing just that. I was working with a group who had almost zero programming experience and just a little database experience. We made things work, but it took 3 quad-P3 servers to run the database (running about 80% capacity 24/8).
Since we were in the R&D wing, we threw the whole thing over to the operations people about the time I headed back to school.
The next semester in school I had a databases class. I was baffled by the lack of understanding we had of even basic database design.
Later I found out that a single operations guy did a complete rewrite of our code in about a week. He had all that useless math background and database experience. His version ran on a single server and was usually at only 50% load.
There are reasons to hire well trained and experienced programmers even for tasks that seem simple.
In response to this and another reply:
I realized this might be a point of contention and misunderstanding. I don't want to discount the importance of earlier grades, etc. However, the fact is that teachers at all level need teaching skills. These are important skills and also differ among the "grades" in our education system, but beyond those skills, the skills of teachers at lower levels are comparable to those of day-care workers. They need to be able to supervise and provide discipline for young children. They also need to impart knowledge, but this knowledge is at a low enough level that most high school graduates SHOULD be able to handle this. On the other hand as you advance up the ladder you need people who have more knowledge and less skill as disciplinarians.
I don't mean to degrade or demean elementary school teachers. My mother is an elementary school teacher and I know that I could never do her job, but I also know that she would not be a good teacher at the high school level or very marketable to companies not in the education or child care fields.
Actually, lots of people don't need to be paid more. The market sets salaries and people get paid for what they produce. However, teachers produce a public good, and are therefore paid by the government, which doesn't need to justify expenses and inflow the same way a company does.
We need GOOD teachers who know their field. Teacher salaries should not be compared to the job market as a whole, they should be compared to the salaries of workers who have a bachelor's degree or better.
When it comes to the welfare of our economy as a whole, teacher's really deserve to make much more than they would in industry. Someone who is great at teaching math or science can help produce hundreds of new workers who are good in that field. The contributions made by these new workers will be much greater than that teacher's contribution would have been if they had gone into industry.
Admittedly, being a great worker and being a great teacher are not mutually inclusive, but a teacher needs to have skills in their field.
As the article cited by the parent points out there are differences in different levels of the education system. I don't mean to offend anyone, but 1st-3rd grade teachers may be getting the salary they deserve at present. At that level, they are basically day care workers whose knowledge doesn't need to go beyond that of a high school graduate. However as you move later in the education process, the teachers need to be more and more knowledgeable to keep up the the material they are teaching.
The reason it wasn't a problem before that time was because intelligent women had zero opportunity elsewhere. They could teach, stay home, or get a menial manufacturing job.
I would agree with little brother on one point.
His teachers do need to be paid more. Teachers make such crappy salaries, it's no wonder good ones are hard to come by. I would love to teach, but since I would have to work harder and get paid about one quarter of what I make with a real job, it just isn't practical.
gdb.
1. run program
2. get uncaught exception
3. ask for a backtrace
The first few lines are library calls taken while deciding what to do with the exception. The rest are useable.
There is at least a small band of new monks part of that monestary.
Last fall the final project for my compilers class was to write a pascal to p-code compiler (for a small subset of pascal, of course).
I really doubt they are spending anywhere near this for the machines themselves. A former student a google employee made one of those recruiting/marketing visits to my university last semester. I got to speek to him at length about Google's operation. According to him (and he had pictures to back this up). All of their boxen are a motherboard, an ide drive and a processor sitting on a shelf in the rack. No cases, no fans, no cd, etc. Plus they buy in bulk and get good prices.
unless you're running a database, a web server, etc and the 'live' process isn't gonna use those pages for a little while. If it really is a 'live' process it won't get swapped out. If you mean 'interactive' process, then you get into the windows trap of optimizing everything for foreground processes and killing your ability to do real multitaking.
Particularly from the linux point of view, dbms/web server/etc performance should be a big issue. This is where linux thrives. And as was mentioned before, this is tunable for desktop users who want to keep the disk cache small because most pages are only needed once anyway.
Duh.
Who thinks that writing a page to disk immediately wipes the ram it came from. This is how things really do work.
The problem is whether this paged but still valid ram should be given to other processes. I would say it is a tuning thing. There is no perfect method that will be best for all situations.
Whoever modded this insightful needs to do a little reading about operating systems.
personal preference in some cases. In some cases it is a difference of readability. In general for loops are meant for iteration and while loops are for condition checking.
I would say either would apply here.
However, for loops and while loops are identical in power. for(a;b;c){d;} is identical to a;while(b){c;d;}. Just rearranging stuff.
I would think that for loops are easier for a compiler to optimize in some cases, though.
because of limitations of some architectures(more specifically their abi), real tail call optimization isn't possible.
I would think even very basic compilers would be able to optimize a simple tail recursion.
BUt from what I've seen a lot of developers don't bother with adding that -O optimization flag, so it doesn't really matter.
a lot of the time, return values are put in registers, so void wouldn't make any difference.
Off topic but interesting:
I recently attended a talk from one of MS's "education evangelists" who go to universities to push Windows. The topic was high-performance and grid computing. I was shocked that he would even try this at a school that is devout about using linux and solaris for CS labs.
I almost laughed out loud when someone asked him what they do about having to run a window manager on every box in a cluster/tight grid environment.
His answer: Whenever they boot the boxes, they go to each one and set the priority of the windowing stuff as low as it will go.
How is it possible that a lab run by MS cannot build a version of the OS that doesn't require the window manager?
Just a back up to the pp.
Apple doesn't scale because you can't put a large number of chips in the same box. x86 isn't as limited, but it's not great either.
As you add processors, there is a diminishing return on inverstment with each one. iow, two uniprocessor boxes will be able to do more work than one dual box, however they cannot operate on the same data at the same time (I know beowulf, etc. give me a break). In some cases, one box with n chips will outperform a box with n+1 chips.
On Sun hardware, this difference is less than on apple and x86 hardware.
Sun's architecture is designed from the ground up to have a bunch of processors in the same box. This is part of the reason that their uni boxen are unimpressive performance wise. Scalability sometimes hurts small scale performance(Think using Oracle/MySQL/PGSQL for a table with 100 rows. Sorting and binary search would be faster).
This is a good idea in theory. Almost all *n*x users do this (or at least the ones with decent administration skills).
However, I've run into several MS programs that have trouble with things like this. They'll store references to the registry in documents. Save files get put in the program directory. And the list goes on. It also becomes a huge hassle on single user Windows systems with more than one user, since there aren't any permissions.
If you are gonna require a password on the BIOS and/or bootloader, why would you let anyone but root shut the machine down?
And hence, the routing is screwed up and possibly 100% of the traffic through that router is dropped or routed inappropriately.