Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Multiprogramming vs multitasking

Status
Not open for further replies.

Manuv16589

New Member
Hi people,
Bit perplexed with multiprocessing and multitasking. If i am right so in multiprogramming multiple programs are in memory and ready for execution but not really executed. But in multitasking multiple programs are executed by switching. Am i right? If not correct me.
 
Multi-processing means there are multiple physical processors in the computer. Multi-tasking means a computer is running more than one progam at a time, the multiple programs are sharing processor time ( switching ) Multi-processing can be combined with multi-taksing to give more time to the vairous programs running.
 
Last edited:
Hi,

Parallel processing is a way of distributing a large task among several core processors, and i find that to be extremely helpful when working on large data sets where the task can be broken up into roughly equal pieces. It really does make the overall task complete in 1/N times the time for one core alone to complete (where N is the number of cores). It's theoretically not exactly that, but it is close and really does seem to complete N times faster.
I usually leave one core open for general user tasks though, so it ends up being N-1 times faster rather than N times faster, with N being the number of cores.
 
Uhg, here is there the vocabulary gets confusing. Parallel processing, as you explain it, sound like what I call multi-threading. I could make that distinct from multi-processing, which simply means more than one program is executing. However, I know things get fuzzy, and the names are used interchangably. I am easily confused by that.
 
Hi again,

Well usually parallel processing means using different physical cores (processors) because simple multitasking insists on doing things sequentially rather than in parallel (at the same time). So for the following x data set where each x has two parts to the program that have to be done sequentially x(part1,part2) where we wanted to say calculate the value of y:
x1=(1,2)
x2=(3,4)

True parallel processing would be operating on 1 and 3 at the same time, and 2 and 4 after that. So while it's doing 1 is is also within the same time period doing 3, and while it is doing the second half of x1 (which is 2 here) it would be also doing the second half of x2 (which is 4 here). So 1 and 3 are parallel and 2 and 4 are parallel, but each set is still done sequentially as two parts.

Multitasking on the other hand would be doing 1, then 3, then 2, then 4, sequentially. In other words it would have to finish 1 before it could get to do 3, then finish that before it could get to do 2, then finish that before it could get to do 4. So it puts the whole task in order sequentially. It appears as though they are being done at the same time by the user because the user sees 1 and 3 getting done possibly too fast to notice that 3 had to wait for 1, but that's not really what is happening.

The real difference is in the overall program speed, where a processor core limited to a given speed would take twice as long to complete the above task as a dual core would take, simply because the dual core can do more processing in the same amount of time. But since there is no way to multitask a single process which depends on sequential data the parallel processing ends up being faster.

Maybe we should look at it more like it really is:
x1(1,2,3,4)
x2(5,6,7,8)

Parallel would mean doing pair (1,5) then doing pair (2,6), then (3,7), then (4,8).
Multitasking would mean doing 1, then 5, then 2, then 6, then 3, then 7, then 4, then 8. This would really be called threading though i think.

That appears to be the right way to look at it. Parallel refers to the time frame tasks are being executed under.
Whether or not a given system can automatically assign tasks to different cores i think is a different issue.

I think i see your point now though, that we can look at multitasking in a more general way rather than thinking of it in terms of multithreading where it seems to have originated.
 
Last edited:
I think the key is to look at these terms in historical context. The meanings of terms shift as technology advances.

Back in the main frame days programs were multi tasked using a scheduler on a single processor but there was a from of parallel processing going on in that the computers had dedicated IO processors.
 
Now we have miltiprogramming, multiprocessing, multithreading, multitasking and parallel processing. There is some overlap in these ideas. Too much; makes my head spin. I've written programs where seperate, multiple programs are running simultaneously, and pass information through "inter-process communication" API. This I would consider multi-tasking. I've also written programs where a single program starts a number of "tasks" that execute under a scheduler. The tasks share informaion through global vairables, or pass information via messages or ques. This I would consider mulit-threading. I've doen this without formal training in programming, so I'm not 100% sure of the vocabulary. Correct me if I"m wrong.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top