hamei wrote:
My point is that in any activity there will be an optimum number of threads. For an exaggerated example, take pbzip. If you have 128 processors and a 256k zipfile, spawning 128 threads to unzip that file would be ridiculous. There is going to be an optimum number of threads for the task at hand. In general, the task at hand is not going to be determined by how many processors you have !
pbzip is IO-bound, so what you said is true. But for most CPU-bound tasks, the number of CPUs you have _is_ the optimal number of threads!
Path tracing (a rendering algorithm) is a task which scales linearly with the number of CPUs available (for all practical purposes... on a NUMA system with 256 cores and more you need to tweak memory placement as well to maintain the speedup, but that's not really important to this discussion). For this task, spawning as many threads as there are CPUs _is_ optimal. If you know a better solution to this that doesn't involve knowing the number of CPUs, then please say so
There are plenty of other CPU-bound workloads which have the same behaviour.
hamei wrote:
This is a pretty crappy solution. Adjusting priority by which application has the focus is way better.
And which application has the focus on a multi-user system?
hamei wrote:
ShadeOfBlue wrote:
However, you must set the nice value manually, since the kernel has no clue which program does what.
Pretty crappy system.
So what you're saying is that the kernel should have a magic crystal ball and use that to determine which process you find more important?
But still, the kernel will age the priority of processes if it figures out they're CPU-bound. The longer a CPU-bound process runs, the less important it becomes to the scheduler. So it should favour IO-bound processes (including GUI).
However, when you're compiling something, the compiler also does IO operations, which causes the kernel _not_ to lower its priority, which explains why you would experience responsiveness issues in this scenario.
Adjusting the nice value of a process will hint the kernel that the process is either less or more important from the start and will keep the system responsive.
hamei wrote:
You're looking at this too much from a programmer's view. Look at it as a computer user for a change. We really don't give a shit if it takes ten seconds longer for the background task to finish. What is important to us is what we are doing. NOW !
If you want to use a UNIX system, help the kernel and run the background tasks at a lower priority, and the system will work exactly as you want it to
If you want the OS to handle UI tasks in a special way, then UNIX is not what you should be using. On UNIX, every one of your processes is equally important to the kernel, unless you tell it otherwise or it figures it out on its own.
IRIX also has a special scheduling class for (soft) real-time processes. If the GUI used that, you wouldn't see any issues with responsiveness. However, SGI must have decided against that for some reason and they use real-time priorities only for recording video and similar tasks.
hamei wrote:
ShadeOfBlue wrote:
There is much less overhead if the program spawns only as many threads as there are CPUs and then distributes work between them.
I do not think this is a good approach.
What would be a good approach then? You've agreed that spawning one thread for each image line isn't the right thing to do, so what is the optimal number of threads for a renderer if you can't get the number of CPUs?
hamei wrote:
And OpenMP sucks dead donkey balls for workstation loads. It's just not optimized for what a workstation should be doing. For some dedicated render machine or a box simulating nuclear explosions, fine. But
not for a workstation
.
It's possible to lower the priority of individual OpenMP threads, so in that case it works just fine on workstations. Within the same app you just check if the user ran the simulation/render job from the GUI or from the command-line and adjust priorities so it doesn't get in their way. Or you could just always use a lower priority. This is similar to the Maya example in my previous post.
hamei wrote:
On a 2p O350, I have to disagree. If the point of having more than one processor is to actually use them, then having one do 70% of the work while the other sits idle and my desktop goes unresponsive, is just bad design
Did you read the rest of my explanation? Spreading threads to other CPUs just because they're free would give you worse overall performance, including GUI apps.
The unresponsiveness isn't caused by the thread placement policy.
hamei wrote:
I don't care if it's inefficient, I want it to do that because I goddamned well want that application running NOW because that's what I am doing NOW.
It would also be inefficient for the usage scenario you describe. If you want the kernel to treat your programs preferentially, then just tell it so!
hamei wrote:
Actually, in real life this is not the case. Grab an old dually something and put OS/2 or BeOS on it.
Both of those OSes were made for much simpler hardware where cache locality and similar concepts didn't matter as much as they do today. If you changed their schedulers to take that into account, they would run even better on new hardware, thread placement isn't responsible for sluggishness. For a single-user machine, I agree, an OS like those would be better.
Speaking of schedulers... I took another look at
Miser
, the batch system on IRIX. It's not a fully-userspace implementation, as I had previously thought, but it has a kernel component too. It runs batch jobs from various user-defined queues whenever the system is idle. This kind of batch system is exactly what I had in mind when I talked about this in a previous post.
Next time, try using "nice gmake -j2" instead of just "gmake -j2". If you're still not happy with the responsiveness of the system, try using Miser. I've used IRIX even under heavy loads and have never experienced the kind of responsiveness issues you describe. It works well enough for me.
Did you experience similar UI responsiveness issues on other SGIs you have?
hamei wrote:
And ja 2, a single-user workstation is looking more and more attractive. What the hell do I really want all these users and groups for ? For most people it's pointless additional complexity. How many users do you really run your desktop as ?
It is useful if you want to ssh into your machine from another location. On single-user OSes like BeOS or classic Mac OS, you'd have to run a VNC server and then you wouldn't get a separate session, you'd just control the session that's currently active.
If you don't need that, then yes, it would be a bit faster and more responsive
hamei wrote:
ShadeOfBlue wrote:
IRIX was made to run on everything from workstations with a single CPU and one user to servers with 1024 CPUs and thousands of users;
Disagree. Remember the Personal Iris ? Indigo ? Indy ? Even the Crimson and Onyxes were "desksides", meant for one or two users, not a cast of thousands. They got into the hpc server schtick later on.
That's what I wrote. The last version of IRIX is used in both scenarios and everything in between.
Even in the Personal Iris era you had the Power Series racks with 8 CPUs and multiple users, so a single-user OS like you describe wouldn't have been useful there.
A big reason why it took off is that you had the same OS on both the low-end workstations and large servers, same behaviour everywhere. This made it easy to develop and test software for it.
hamei wrote:
The fact is, in many ways Yewnix is one huge kluge .... so we get new toolkits by the dozens while the underlying structural problems are wallpapered over. Post-modern society, whoopee
You might like Plan 9, it was designed from ground up to fix the kludge that UNIX has accumulated over the years. However, since most people think that UNIX-like systems are good-enough (or aren't bothered enough to look for alternatives), it doesn't get much attention.
Another problem with alternative operating systems like BeOS and such is that they lack software. An OS without software is useless. If every program you need to do your work is only available on UNIX or crappier alternatives, then you don't really have much of a choice