473,785 Members | 2,395 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

create BackgroundWorke r from BackgroundWorke d is possible?

I want to create a "thread manager" class to manage an array of
backgroundworke rs. I'd like this thread manager class to live in a class
library and I wasn't sure if it was possible to make the thread manager a
subclass of the backgroundworke r so that I could start it up and still do
other things on the client. Essentially a thread that spins off new threads.

Am I going to hit any limitations here?

thank you
Jun 27 '08 #1
3 1839
I'm not quite sure why you would want this class be subclass the
ThreadManager - and I'm alson not quite sure whether you can't simply
use ThreadPool here - can you explain the scenario a bit more?

Marc
Jun 27 '08 #2
On Apr 25, 6:27*am, "Coaster" <Coas...@Coaste r.netwrote:
I want to create a "thread manager" class to manage an array of
backgroundworke rs. I'd like this thread manager class to live in a class
library and I wasn't sure if it was possible to make the thread manager a
subclass of the backgroundworke r so that I could start it up and still do
other things on the client. Essentially a thread that spins off new threads.

Am I going to hit any limitations here?

thank you
Ho,

Yes, you can derive from it. Why though is a different question.
Are you going to do some sync. among the threads?

Other than that I see no explanation why
Jun 27 '08 #3
On Sat, 26 Apr 2008 08:53:29 -0700, Coaster <Co*****@Coaste r.netwrote:
[...] So my main question was if I created
a backgroundworke r to execute the threadmanager (either thru subclassing
or
not) will it be able to create other backgroundworke rs to execute the
tasks?
I rememeber something from my c++ days about worker threads couldn't
create
other worker threads or gui threads, I forgoet but I was looking to see
if
such a limitation exists in this environment.
No such limitation existed in C++, though depending on what mechanism you
used to create threads, you may have needed to initialize the CRT for a
specific thread before creating a new thread from that thread.

In any case, nothing like that is an issue in .NET. You can create new
threads from any other thread. And you can create new BackgroundWorke r
instances from threads executing an existing BackgroundWorke r instance.

Now, that's not to say that whatever you're trying to do is necessarily
the best way to do it. Your problem description is rather vague, and it
seems to state a design requirement that wouldn't normally come up.

But whatever the design requirement, creating a new threading objects from
existing threading objects isn't a problem in .NET.

Pete
Jun 27 '08 #4

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

Similar topics

5
2229
by: JHoletzeck | last post by:
Is it possible to set the stack size for the thread created by BackgroundWorker like in the API call _beginthread? If not is the stack size a default or the one I set for the whole application? (What I need is a worker thread with a rather large stack in a Windows Forms app complied with /clr:pure) Cheers Jürgen
7
3243
by: Roemer | last post by:
Hi all I stumbled over a new problem: I have a programm with just a class that is asynchronous listening for network connections. As soon as someone connected, a new form needs to be created. The Form gets created but hangs after creation. I'ts logical that that happens because the new Form doesn't get a Message Loop. The Message Loop is created on Application.Run() on the Main Method on the Main Thread. The Callback is (normally)...
0
1085
by: Nicolas Zenou | last post by:
Hey everyone, I am new to .NET Framework programing and I have an important question. In fact, I need to launch many thread in my application. I assume to use backgroundWorker which are really easy to use. The plateform where the application will run is a Bi processor. I wanted to know if its possible to assign each of my backgroundWorker to one processor, as it is possible for "normal" thread throw the Process.ProcessorAffinity...
5
14134
by: Rob R. Ainscough | last post by:
I'm using a BackgroundWorker to perform a file download from an ftp site. Per good code design practices where I separate my UI code from my core logic code (in this case my Download file method in my FileIO class) I've established Public Event in my core logic classes along with RaiseEvents (that will updated a progress bar on the UI side). This all works great when I'm NOT using Threading (BackgroundWorker), however, as soon as I...
14
6396
by: =?Utf-8?B?SXNobWFlbA==?= | last post by:
Hi, I have a form with a progress bar on it and wanted to use the BackgroundWorker to be able to update the progress. I looked at examples, run some of them, but in debug, when the code gets to the do work method, it stops for a long while and then executes the first line of the method and the doesn't do anything else. What am i doing wrong?
8
16582
by: =?Utf-8?B?cmFuZHkxMjAw?= | last post by:
I have an application with several BackgroundWorker threads. I hoped I'd be able to just type backgroundworker1.Name = "bw1"; but I don't see a name property. Any thoughts on how to name a backgroundworker thread? Thanks, Randy
9
18036
by: RvGrah | last post by:
I'm completely new to using background threading, though I have downloaded and run through several samples and understood how they worked. My question is: I have an app whose primary form will almost always lead to the user opening a certain child window that's fairly resource intensive to load. Is it possible to load this form in a backgroundworker and then use the Show method and hide method as necessary? Anyone know of
4
6403
by: =?Utf-8?B?U3ZlbiBXLg==?= | last post by:
Hi Newsgroup, I am developing a C# Windows Forms application that launches processes within a background worker.. The processes seem to have a memory limit of about 278mb. Some proccesses that get to that amount of used memory seem to hang ;-( Is there a memory limit that can be adjusted ?? The physical machine has 3
0
1020
by: simopal6 | last post by:
Hello! I have a Windows Form with many buttons which do different time-consuming things. Currently, for each of these operations I have a separate BackgroundWorker, but it would be better if I had only one, since I'm not going to have two BackgroundWorkers run at the same time. Is it possible to use only one BackgroundWorker, and changing the DoWork delegate each time? I've seen that DoWork can be changed only via the += and -= operators, so...
0
10161
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9958
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8986
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7506
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5390
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5523
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4058
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3662
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.