Results 1 to 5 of 5

Thread: Problem with Multithreading in C Language

  1. #1
    Join Date
    Jan 2009
    Posts
    65

    Problem with Multithreading in C Language

    I am a bit confused about C language concept named to be multithreading. I just don't understand this concept as not from a programmer backgroung. Please help me with this concept and if possible provide an example too.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Problem with Multithreading in C Language

    Multithreading is becoming an increasingly important part of modern programming. One reason for this is that multithreading enables a program to make the best use of available CPU cycles, thus allowing very efficient programs to be written. Another reason is that multithreading is a natural choice for handling event-driven code, which is so common in today�s highly distributed, networked, GUI-based environments. Of course, the fact that the most widely used operating system, Windows, supports multithreading is also a factor. Whatever the reasons, the increased use of multithreading is changing the way that programmers think about the fundamental architecture of a program. Although C++ does not contain built-in support for multithreaded programs, it is right at home in this arena.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: Problem with Multithreading in C Language

    Multithreading is growing in importance in modern programming for a variety of reasons, not the least of which being that Windows supports multithreading. While C++ does not feature built-in support for multithreading, it can be used to created multithreaded programs, which is the subject of this article. It is taken from chapter three of The Art of C++, written by Herbert Schildt (McGraw-Hill/Osborne, 2004; ISBN: 0072255129).

    Multithreading is becoming an increasingly important part of modern programming. One reason for this is that multithreading enables a program to make the best use of available CPU cycles, thus allowing very efficient programs to be written. Another reason is that multithreading is a natural choice for handling event-driven code, which is so common in today’s highly distributed, networked, GUI-based environments. Of course, the fact that the most widely used operating system, Windows, supports multithreading is also a factor. Whatever the reasons, the increased use of multithreading is changing the way that programmers think about the fundamental architecture of a program. Although C++ does not contain built-in support for multithreaded programs, it is right at home in this arena.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Problem with Multithreading in C Language

    Multithreading is a specialized form of multitasking. In general, there are two types of multitasking: process-based and thread-based. A process is, in essence, a program that is executing. Thus, process-based multitasking is the feature that allows your computer to run two or more programs concurrently. For example, it is process-based multitasking that allows you to run a word processor at the same time you are using a spreadsheet or browsing the Internet. In process-based multitasking, a program is the smallest unit of code that can be dispatched by the scheduler.

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    Re: Problem with Multithreading in C Language

    Multithreading changes the fundamental architecture of a program. Unlike a single-threaded program that executes in a strictly linear fashion, a multithreaded program executes portions of itself concurrently. Thus, all multithreaded programs include an element of parallelism. Consequently, a major issue in multithreaded programs is managing the interaction of the threads.

    As explained earlier, all processes have at least one thread of execution, which is called the main thread. The main thread is created when your program begins. In a multithreaded program, the main thread creates one or more child threads. Thus, each multithreaded process starts with one thread of execution and then creates one or more additional threads. In a properly designed program, each thread represents a single logical unit of activity.

Similar Threads

  1. What is the difference between multithreading and multiprocessing?
    By Alphonsus in forum Software Development
    Replies: 8
    Last Post: 27-04-2011, 11:23 PM
  2. Multithreading in intel IPP
    By Assasin boy in forum Motherboard Processor & RAM
    Replies: 9
    Last Post: 26-09-2010, 03:25 AM
  3. Multithreading and ArrayList
    By Logan 2 in forum Software Development
    Replies: 5
    Last Post: 09-02-2010, 05:16 AM
  4. run method of MultiThreading
    By beelow in forum Software Development
    Replies: 3
    Last Post: 14-11-2009, 10:18 AM
  5. forks and multithreading
    By invincibledj20 in forum Software Development
    Replies: 0
    Last Post: 12-11-2008, 07:55 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,853,534.82385 seconds with 16 queries