473,387 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Threading in Visual C++.NET

Hi,

I was wondering if anyone can assist me in initating
some threading appliaction in VC.NET. I am trying to do
a server, and will need to spawn multiple ports to listen
on, but I can seem to find any decent sample on code that
will allow threading.

Any assistance will be greatly appreciated. Also, if
some general understanding can be given, as in how to
destroy the threads when needed, etc, that would really
help as well.

Thank You,

Filip
Nov 17 '05 #1
1 3071
You don't destroy a thread, let it die on its own. This is the tricky part
for beginners. Read about "signals" and "events" in threads.

Use a vector/list to store pointers to the thread-structures. This way you
have an easy way to parse all thread structures if you have to do this in
your main thread. Don't destroy the main thread before all child threads
have died. A thread can only run once. If you want to run the same threads
multiple times, you have to call "new" on the objects for each restart.

Search amazon for a .net threading book. I don't have my books infront of me
(I'm on holiday with a laptop and a modem), but there are written many good
books on this.

Lars-Inge
http://www.larsigne.com
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: mjheitland | last post by:
Hi, I like to know how many threads are used by a Threading.Timer object. When I create a Threading.Timer object calling a short running method every 5 seconds I expected to have one additional...
15
by: aikwee | last post by:
hi all, i have a software written in vb.net which has many thread in it. The software basically use about 8 threads to monitor in coming data from serial port, and some other thread that...
4
by: Michael D Murphy | last post by:
Hi, I need to use Windows Meadia Player control in my application to run som mpeg movies. There is no user interface, I need to control everything programatically. I do not want to use the...
8
by: NewUser | last post by:
Hello, I'm a new user to Visual Basic.net and I would appreciate any help regarding a problem I have. I have searched the posts in this newsgroup and the VB library for threading topics, but I...
2
by: dzemo | last post by:
I want to have two thread at the same time to execute. Both of threads have to execute some code in specific intervals for example first thread have to read from COM port every 5 seconds and other...
14
by: Christian Kaiser | last post by:
We have a component that has no window. Well, no window in managed code - it uses a DLL which itself uses a window, and this is our problem! When the garbage collector runs and removes our...
8
by: cj | last post by:
I need more information to read about threading in Visual Basic. Hopefully something linear w/o too many links to get lost in. I've been to...
6
by: Fred Exley | last post by:
Just trying to understand the basics here. If the OS has just one CPU, what advantage is there in threading? thanks
4
by: Steven | last post by:
I am taking an "advanced" VB.Net course via web at a state university toward an information science degree. This is my second VB class and I am kind of disappointed in it. This week we covered...
10
by: Janto Dreijer | last post by:
I have been having problems with the Python 2.4 and 2.5 interpreters on both Linux and Windows crashing on me. Unfortunately it's rather complex code and difficult to pin down the source. So...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.