[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

What Is The Difference Between Multi-Core and Multi-task?

Posted on 2008-11-11
6
Medium Priority
?
325 Views
Last Modified: 2012-05-05
What Is The Difference Between Multi-Core and Multi-task?

Quote "When running on a multicore system, multitasking OSs can truly execute multiple tasks concurrently. The multiple computing engines work independently on different tasks.

For example, on a dual-core system, four applications - such as word processing, e-mail, Web browsing, and antivirus software - can each access a separate processor core at the same time. You can multitask by checking e-mail and typing a letter simultaneously, thus improving overall performance for applications."

>>can each access a separate processor core at the same time.
this means there won't be any time sharing between these four processors. right?
0
Comment
Question by:F-J-K
6 Comments
 
LVL 3

Accepted Solution

by:
sistemu earned 800 total points
ID: 22928809
Until the multi-processor appeared, multi-tasking was only "pseudo-multi-tasking". Multiple tasks were possible, but at one particular moment, only one program was running.
Now, with multiple processes on our hands, multi-tasking is real, and yes, two programs can run simultaneously(or at least one thread of each program).
Time sharing will exist while users will run more programs than cores on a computer.
0
 
LVL 53

Assisted Solution

by:Infinity08
Infinity08 earned 400 total points
ID: 22928897
multi-core refers to the CPU having multiple cores - the CPU is basically not just one CPU, but a set of a few CPU's that run at the same time.

multi-task refers to a capability of the OS, namely to run multiple programs at the same time, and taking care of giving each of those programs a fair share of CPU time (note that most modern OSs are multi-task OSs).

If such an OS has a multi-core CPU, it can take advantage of that fact by truly running multiple applications at the same time (by running them on different cores).
0
 
LVL 39

Assisted Solution

by:itsmeandnobodyelse
itsmeandnobodyelse earned 800 total points
ID: 22929640
>>>> multi-tasking was only "pseudo-multi-tasking".
Even for one processor and one core, any modern computer will run at least 10 to 100 processes (each process with at least one thread) same time. The switching between threads is so fast that in most cases it makes no difference whether processes run concurrently or mutually exclusive.  So it seems to me the ability of an operation system to run multiple 'tasks' concurrently cannot be called a 'pseudo-multitasking'. It includes a very fast scheduling and a complete separation of each task (of course beside of usage of shared resources).

If any pair of threads were sharing the same piece of memory they would need to synchronize access to that memory regardless whether the threads were running on different cores or on the same core. If they do not it could happen that thread 1 reads a value nearly same time than thread 2 makes an update to that value. Hence any further update made by thread 1  was based on wrong information.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Assisted Solution

by:sistemu
sistemu earned 800 total points
ID: 22929828
I apologize, I didn't use in the proper place the pseudo prefix :D It's a partially-altered memory from high-school where we learned that even though multitasking OS's run many processes simultaneously, it's in fact only pseudo-simultaneous (till the appearance of multi-core and multi-CPU computers) because on a core only one thread can run at a particular moment.
0
 
LVL 39

Assisted Solution

by:itsmeandnobodyelse
itsmeandnobodyelse earned 800 total points
ID: 22932780
>>>> I apologize
You must not. It is true that with multi-processors and multi-cores there is a new quality as the operation system needs to synchronize and manage the cores and their access to all shared resources. My point is that for the application development there is little difference whether the multi-tasking happens at one core or at different cores. One difference is that incrementing a global integer can no longer be expected to happen as an atomic operation. You may argue that you can't expect that on a single-core either but actually I made a 24-hour test a few years ago and never had one single case where two threads would read the same global value but only one incrementation was performed.  I was talking from synchronization code like

      while (++g_sync > 1)
      {
            // coming here two threads have incremented nearly same time
            // redo the incrementation and try again
            --g_sync;
      }

It was in 1983 when I first used code like the above on a multi-processor machine (VAX8350). And once in a few months it actually happened that two clients both tried to communicate with the database server what led to a database communication error (thus we found it out). We changed the above code to

       while (atomic_increment(g_sync) > 1)
      {
            // coming here two threads have incremented nearly same time
            // redo the incrementation and try again
            atomic_decrement(g_sync);
      }

and it worked.
0
 
LVL 1

Author Closing Comment

by:F-J-K
ID: 31515437
Great!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question