LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-02-2008, 01:28 AM   #1
Ashok_mittal
Member
 
Registered: Dec 2007
Posts: 73

Rep: Reputation: 15
Lightbulb Real application using threads


Hi all,

Greetings for new year.Can anyone give me some hints about writing
a real application using threads.I have studied threads programming like creating,join,condition variables and made progarms to understand the concept now i want to make an application so that i can fully understand this concept.
Regards
Ashok

Last edited by Ashok_mittal; 01-02-2008 at 03:13 AM. Reason: grammetical mistakes
 
Old 01-02-2008, 07:51 AM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Not sure exactly what your looking for here but the first thing I did using threading was a very simple server application.

It spawned a thread for listening for connections. When a connection came in it spawned a thread to handle the particular connection and the listening thread then went back to listening for new connections. When the connection was dropped the thread to handle it went away.

The next step was to make it a little more intelligent. I created a thread for listening and 5 threads that's jobs were to handle established connections based on who needed handling (by having each of them wait on a select call). This is effectively a very basic example of thread pooling.
 
Old 01-03-2008, 12:29 AM   #3
Ashok_mittal
Member
 
Registered: Dec 2007
Posts: 73

Original Poster
Rep: Reputation: 15
Sir i am looking for an application based on threads just like the hint you have given to me.Can u explain me more about this server application.


Quote:
Originally Posted by jtshaw View Post
Not sure exactly what your looking for here but the first thing I did using threading was a very simple server application.

It spawned a thread for listening for connections. When a connection came in it spawned a thread to handle the particular connection and the listening thread then went back to listening for new connections. When the connection was dropped the thread to handle it went away.

The next step was to make it a little more intelligent. I created a thread for listening and 5 threads that's jobs were to handle established connections based on who needed handling (by having each of them wait on a select call). This is effectively a very basic example of thread pooling.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Balancing Real Time Threads LXer Syndicated Linux News 0 10-21-2007 06:21 AM
Help with deciding Linux capability for Real-Time application anantvemuri Linux - Kernel 3 03-04-2007 01:44 PM
LXer: Cluster Interconnects: Real Application Performance and Beyond LXer Syndicated Linux News 0 01-11-2007 07:54 AM
LXer: Developing a real-time Linux data acquisition application LXer Syndicated Linux News 0 08-21-2006 11:54 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration