Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 09-03-2009
Member
 
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.
Reply With Quote
  #2  
Old 09-03-2009
Member
 
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.
Reply With Quote
  #3  
Old 09-03-2009
Member
 
Join Date: May 2008
Posts: 2,008
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.
Reply With Quote
  #4  
Old 09-03-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
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.
Reply With Quote
  #5  
Old 09-03-2009
Member
 
Join Date: May 2008
Posts: 2,293
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Problem with Multithreading in C Language"
Thread Thread Starter Forum Replies Last Post
What is the difference between multithreading and multiprocessing? Alphonsus Software Development 8 27-04-2011 11:23 PM
Multithreading in intel IPP Assasin boy Motherboard Processor & RAM 9 26-09-2010 03:25 AM
Multithreading and ArrayList Logan 2 Software Development 5 09-02-2010 05:16 AM
run method of MultiThreading beelow Software Development 3 14-11-2009 10:18 AM
forks and multithreading invincibledj20 Software Development 0 12-11-2008 07:55 PM


All times are GMT +5.5. The time now is 09:07 PM.