473,396 Members | 2,140 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,396 software developers and data experts.

create BackgroundWorker from BackgroundWorked is possible?

I want to create a "thread manager" class to manage an array of
backgroundworkers. 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 backgroundworker 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 1814
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...@Coaster.netwrote:
I want to create a "thread manager" class to manage an array of
backgroundworkers. 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 backgroundworker 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*****@Coaster.netwrote:
[...] So my main question was if I created
a backgroundworker to execute the threadmanager (either thru subclassing
or
not) will it be able to create other backgroundworkers 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 BackgroundWorker
instances from threads executing an existing BackgroundWorker 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
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?...
7
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....
0
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...
5
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...
14
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...
8
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...
9
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...
4
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...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...

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.