dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 14 of 14

Thread: what is the difference b multitasking and multithreading ?

  1. #1
    Join Date
    Oct 2017
    Location
    Kolkata,India
    Posts
    1

    what is the difference b multitasking and multithreading ?

    Disscus

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,262

    Re: what isthe difference b multitaking and multithreading ?

    It was already discussed a lot since a long time before...
    https://www.google.ch/search?q=multi...hrome&ie=UTF-8
    Multithreading means in any single process, multiple threads is allowed and again, can run simultaneously. Multitasking is sharing of computing resources(CPU, memory, devices, etc.) among processes, while multithreading is sharing of computing resources among threads of a single process.
    Victor Nijegorodov

  3. #3
    Join Date
    Aug 2017
    Posts
    38

    Re: what isthe difference b multitaking and multithreading ?

    In multitasking, several programs are executed concurrently e.g. Java compiler and a Java IDE like Netbeans or Eclipse, while in multi-threading multiple threads execute either same or different part of program multiple times at the same time .

  4. #4
    Join Date
    Apr 2017
    Posts
    10

    Re: what isthe difference b multitaking and multithreading ?

    Multitasking means several programs are executed concurrently and multi threading means several threads execute at the same time..

  5. #5
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    6,513

    Re: what isthe difference b multitaking and multithreading ?

    Multi-tasking is the sharing of computing resources (CPU, memory, devices, etc.) among processes, whilst multi-threading is the sharing of computing resources among threads of a single process. This sharing may or may not be concurrent - depending upon number of physical processors etc. Eg. if there are 4 physical processors then there can be 4 threads concurrently executing; if there is only 1 physical processor then there can be only 1 thread executing at any one time.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2017 (15.9.4)

  6. #6
    Join Date
    Jan 2018
    Posts
    15

    Re: what isthe difference b multitaking and multithreading ?

    The title fooled me! I was asking "what is Multitaking?" turn out it's Multitasking, which means having multiple tasks, programs, processes running at the same time. While Multithreading is a model for a single process can have multiple code.

  7. #7
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    6,513

    Re: what isthe difference b multitaking and multithreading ?

    Quote Originally Posted by LinckeU View Post
    The title fooled me! I was asking "what is Multitaking?" turn out it's Multitasking, which means having multiple tasks, programs, processes running at the same time. While Multithreading is a model for a single process can have multiple code.
    Yeah. I've corrected the title.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2017 (15.9.4)

  8. #8
    Join Date
    Feb 2018
    Posts
    2

    Re: what isthe difference b multitaking and multithreading ?

    In multitasking the basic thing is that you're running multiple "programs" simultaneously and by simultaneously I mean using time sharing or any similar algorithm where you may or may not use multiple processors.
    On the other hand in multithreading you run several tasks of the same program simultaneously, using the same algorithms as that of multitasking which may or may not use multiple processors.

  9. #9
    Join Date
    Dec 2018
    Posts
    6

    Re: what is the difference b multitasking and multithreading ?

    Key Differences Between Multitasking and Multi-threading in OS

    The basic difference between multitasking and multi-threading is that in multitasking, the system allows executing multiple programs and tasks at the same time, whereas, in multi-threading, the system executes multiple threads of the same or different processes at the same time.

    In multitasking CPU has to switch between multiple programs so that it appears that multiple programs are running simultaneously. On other hands, in multi-threading CPU has to switch between multiple threads to make it appear that all threads are running simultaneously.

    Multitasking allocates separate memory and resources for each process/program whereas, in multi-threading threads belonging to the same process shares the same memory and resources as that of the process.

  10. #10
    Join Date
    Feb 2017
    Posts
    375

    Re: what is the difference b multitasking and multithreading ?

    Here's a site called TechDifferences. It's basically answers to lots of what's-the-difference-between-X-and-Y questions. The info seems solid but strangely it's not clear who's providing the information and why. Anyway here's their take on this particular question,

    https://techdifferences.com/differen...ing-in-os.html

  11. #11
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    12,840

    Re: what is the difference b multitasking and multithreading ?

    Seems the multitheaded explanations referenced are a bit lacking. Sure, single processor, single core hardware of 20 years ago context switched threads to gave the appearance of simultaneous execution. However, with multi-processor, multi-core hardware of today, the thread scheduler still context switches, but threads can actually execute simultaneously.

  12. #12
    Join Date
    Feb 2017
    Posts
    375

    Re: what is the difference b multitasking and multithreading ?

    Quote Originally Posted by Arjay View Post
    Seems the multitheaded explanations referenced are a bit lacking. Sure, single processor, single core hardware of 20 years ago context switched threads to gave the appearance of simultaneous execution. However, with multi-processor, multi-core hardware of today, the thread scheduler still context switches, but threads can actually execute simultaneously.
    The multitasking explanation is also lacking. In cooperative multitasking there's not necessarily "a frequent switching between tasks". It could be so but that's up to the tasks. So multitasking can be used to create an illusion of simultaneously running tasks but it's in fact a broader concept than that.

    Still I think the reference I suggested works quite well from a mainstream operating systems perspective. It's almost impossible to contrast general concepts without at least some inconsistency in some corner.

    I don't think the multi-core hardware of today changes anything really. Multiprocessor computer systems have been around for ages. And the thread dispatcher's job of managing a number of concurrent threads is conceptually the same regardless of the number of available physical processors.
    Last edited by wolle; Today at 07:14 AM.

  13. #13
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    12,840

    Re: what is the difference b multitasking and multithreading ?

    I'm referring to the following which is a quote from post #9 but essentially was also in the link in post #10.

    in multi-threading CPU has to switch between multiple threads to make it appear that all threads are running simultaneously.
    My issue is with "make it appear that all threads run simultaneously". On multi-proc or multi-core hardware, there is no 'appear', they do run simultaneously when procs/cores are available.

    Perhaps a subtle distinction not worth mentioning.

  14. #14
    Join Date
    Feb 2017
    Posts
    375

    Re: what is the difference b multitasking and multithreading ?

    Quote Originally Posted by Arjay View Post
    My issue is with "make it appear that all threads run simultaneously". On multi-proc or multi-core hardware, there is no 'appear', they do run simultaneously when procs/cores are available.

    Perhaps a subtle distinction not worth mentioning.
    Well, multithreading is an abstract concept. It hides the dependency on the number of processors by only requiring that threads appear to be running simultaneously. Whether and when they actually run simultaneously or only appear to do so is left to the implementation.

    Every implementation of multithreading exhibits a phase-shift when all processors are busy and threads must start competing for processor time (and this is true also for single processor systems). There is nothing subtle about this and it is worth mentioning but it is an implementation detail.
    Last edited by wolle; Today at 05:37 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)