Sign in with
Sign up | Sign in
Your question

Why aren't there more multithreaded programs/applications?

Last response: in Applications
Share
February 25, 2010 12:32:27 PM

I'm just wondering why companies aren't making multithreaded programs. I've been doing some reading and people are saying it's just like learning a 2nd language.

Don't get me wrong, I only know C, I'm just wondering.
February 25, 2010 1:00:54 PM

because it is not easy for a lot of applications, especially UI work, there are even some algorithms that cannot be be multi-threaded

though if you are into programming, have you tried any multi-threaded programming in C, its not fun
m
0
l
a b L Programming
February 25, 2010 6:25:10 PM

Here's an excercise to help you understand multi-threaded programming:

1. Open Task Manager.

2. Open the "View/Select Columns" menu.

3. Tick the box next to "Threads".

4. Click "OK".

5. Examine display, paying particular attention to the column "Threads".

Now - what was the question again?
m
0
l
Related resources
February 26, 2010 1:48:53 AM

You're probably going to think I sound like a jackass, but I don't use Windows right now - W7 was bugging out (re-installed it twice, luckily it's free through MSDNAA). I went into System Monitor (Ubuntu 9.10), and tried to do the same thing, but there was no similar choice.

I'll take it from your response that their are, indeed, several processes that utilize multi-threaded programming?

This wasn't a question about why companies suck and why they don't know how to do it. I have noticed that only 1 core (on my core 2 duo) goes up to 100%, while the other sits around 10% - if that. I'm not going to get a new pc for a year or so (mine is on it's 4th year), and I know that it's a little outdated, so it's sure as hell not going to be "fast", I didn't really care about speed at the time, but now that my computer is old, it would be nice if both cores were utilized when I open things (since Ubuntu is now freezing up 3-4 times/day due to the processor being at 100%).
m
0
l
a b L Programming
February 26, 2010 5:59:32 AM

Most Windows programs are fairly highly threaded. Doing that exercise on my Windows 7 setup shows no programs at all with only one thread. Because threads are not implemented so efficiently on Linux, and processes more so, programs have more of a tendency to be implemented as single-threaded processes on Linux.

It's probably true that only one process, or even thread, at a time is utilizing a high percentage of CPU time, but that doesn't mean that the programs are not highly threaded. 99.9% of the threads on a system will be blocking waiting for some event at any given instant.
m
0
l
a b L Programming
March 2, 2010 12:27:28 PM

First, not every task can be multithreaded. The classic real-life example is that it doesn't take 1 month for 9 women to make a child. Secondly, multithreading adds lots of complexities, mostly related to resource locking and synchronization. Just take a look at basic multithreading examples found around, they are relatively complex for trivial functionalities.

As mindless728 said, try to make a simple multithreaded demo app in C or even Java and see how "fun" it is. You can try trivial implementation like the Dinning philosophers or Producer-consumer.
m
0
l
March 29, 2010 8:07:41 AM

A simple application you can write in C is a Que based delegation of various tasks. Wont get the same stuff as pre-emptive multi-tasking. But you will run into Zenthar's problem real quick.

You can however, thread all day long with store and forward queues basing you application of like a centralized messenger with multiple servers delegating tasks.

Simply put; write a traffic cop that directs traffic in NYC when the street lights have gone out; you go do this; hey idiot you do that, take a peek see if they did it, report the results. With 50 or so cars stacked up and pedestrians messing with the queue.
m
0
l
April 11, 2010 12:40:59 PM

Hemroid said:
You're probably going to think I sound like a jackass, but I don't use Windows right now - W7 was bugging out (re-installed it twice, luckily it's free through MSDNAA). I went into System Monitor (Ubuntu 9.10), and tried to do the same thing, but there was no similar choice.

I'll take it from your response that their are, indeed, several processes that utilize multi-threaded programming?

This wasn't a question about why companies suck and why they don't know how to do it. I have noticed that only 1 core (on my core 2 duo) goes up to 100%, while the other sits around 10% - if that. I'm not going to get a new pc for a year or so (mine is on it's 4th year), and I know that it's a little outdated, so it's sure as hell not going to be "fast", I didn't really care about speed at the time, but now that my computer is old, it would be nice if both cores were utilized when I open things (since Ubuntu is now freezing up 3-4 times/day due to the processor being at 100%).


I attempted it on Windows and only around 10% of my processes use only one thread, and they're all auto-updaters or basic monitors of some sort. Apache is second only to Windows system idle process.

But as people say, not everything can, or needs to be, multithreaded.
m
0
l
!