Home Technology Subscribe to RSS
 

What Do You Know About Multithreading?

Answer Question

2 Answers - Sort by: Date | Rating

    Multithreading is a technique in which a process, executing an application, is divided into threads that can run concurrently. Thread: A dispatch unit of work. It includes a processor context (which includes the program counter and stack pointer) and its own data area for a stack (to enable subroutine branching). A thread executes sequentially and is interruptible so that the processor can turn to another thread. Process: A collection of one or more threads and associated system resources (such as memory containing code and data, open files, and devices).

    This corresponds closely to the concept of a program in execution. By breaking a single application into multiple threads, the programmer has great control over the modularity of the application and the timing of application related events. Multithreading is useful for applications that perform a number of essentially independent tasks that do not need to be serialized. An example is a database server that listens for and processes numerous client requests. With multiple threads running within the same process, switching back and forth among threads involves less processor overhead than a major process switch between different processors. Threads are also useful for structuring processes that are part of the OS kernel.
    0 0

    Data 

    answered 3 years ago

      Multiple threads can be executed in parallel to each other on many computer systems. This multi-threading usually occurs by time slicing. It is similar to time division multiplexing, wherein a single processor switches between so many different threads. This switching happens so fast as to give the illusion of simultaneity to the end user. For example, most of the PCs today only contain one processor core, but you can run multiple programs at once, such as typing in a document editor while listening to music in an audio playback program; although the user experiences these things as simultaneous, in truth, the processor quickly switches back and forth between these separate processes.

      On a multiprocessor or multi-core system, now coming into broad use, threading can be achieved through multiprocessing, wherein different threads and processes can run accurately simultaneously on different processors or cores.

      Many of the modern operating systems directly support both time-sliced and multiprocessor threading with a process scheduler. The operating system kernel permits programmers to manipulate threads via the system call interface. Some implementations are called a kernel thread, while a lightweight process is a particular type of kernel thread that shares the same state and information.
      0 0

      Srana 

      answered 3 years ago

        Answer Question - Answers are editable for 5 min.

        If you do not Sign-in or Register your answers will be anonymous,

        your answers may also be checked before going online.

        More

           
           

          Ask a Question via Twitter

          Send a question to @askblurtit and we will publish it online and send you a reply everytime you receive an answer.

          Blurtit Store

          Get T-shirts, hoodies, caps and more at the Blurtit store

          Blurtit International