Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

project to learn multithreading 1

Status
Not open for further replies.

voodoojon

Technical User
Dec 18, 2003
107
0
0
GB
Hi everyone,

I am trying to teach myself C#, and I want to learn how to use C#'s multithreading capacities. I have looked on the web for example projects, but they are all incredibly simple, for example a console app which creates a few threads, starts them and outputs some text. This still doesn't really give me a feel for how threads are used in real applications that do useful things. Can anyone give me an idea for a project I can create where I will need to manage threads properly to make it sucessful.

Thanks in advance,

Jon

Jon

One day I will find a signature worthy of this space. That day has not yet come.
 
Generally, you should try to keep threads simple.

If you want something a bit complex, try listening to traffic on a port on a separate thread and when a message is received, pass that message to a different socket on a different thread.

Suddenly you have a type of routing system.


MainThread
|
|
Thread A --|-- Thread B
Port 8888 | Port 9999
| | |
| | |
MsgRECV----| |
| | |
| Log |
| | |
| | |
| |-----MsgSEND
| | |
| | |

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top