1 / 9

MULTITHREADING PROGRAMMING

MULTITHREADING PROGRAMMING. MULTITASKING It is same as multithreading. Multitasking in java is a process of executing multiple tasks simultaneously. Multithreading and Multiprocessing both are used to achieve multitasking. In multitasking we have two methods.

tamala
Download Presentation

MULTITHREADING PROGRAMMING

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MULTITHREADING PROGRAMMING

  2. MULTITASKING It is same as multithreading. Multitasking in java is a process of executing multiple tasks simultaneously. Multithreadingand Multiprocessing both are used to achieve multitasking. In multitasking we have two methods. Process based Multitasking(Multiprogramming) Thread based Multitasking(multithreading)

  3. Process based Multitasking(Multiprogramming) Each process has an address in memory . A process is a heavyweight. Cost of communication between the process is high. Thread based Multitasking(multithreading) Threads share the same address space A thread is lightweight. Cost of communication between the thread is low

  4. ADVANTAGES OF MULTITHREAD It doesn’t block the user because threads are independent. The user can perform many operation together, so it saves time. Threads are independent, so it doesn’t affect other threads.

  5. SINGLE THREADED PROGRAM Single thread used to perform only one task. A thread is a lightweight sub-process, the smallest unit of processing. class ABC { …. public void run(..) { … .. } }

  6. MULTITHREADING PROGRAMMING Multithreading in java is a process of executing multiple threads simultaneously. Its also called as multitasking.

  7. A Multithreaded Program Main Thread start start start Thread A Thread B Thread C Threads may switch or exchange data/results

  8. Threads Concept Multiple threads on multiple CPUs Multiple threads sharing a single CPU

  9. THANK YOU

More Related