.net - Feedback From Threads To Main Program?

Jan 27, 2011

My software will simulate a few hundred hardware devices, each of which will send several thousand reports to a database server.Trying it without threading did not give very good results, so now it's time to thread.Since I am load testing the d/b server, some of those transactions will succeed and a few may fail. The GUI of the main program needs to reflect this. How should the threads communicate their results back to the main program? Update global variables? Send a message? Or something lese?

Now, if I update only at the end of each thread then the GUI is going to look rather boring (and I can't tell if the program hung). It might be nice to update the GUI periodically. But that might cause contention, with threads waiting for other threads to update (for instance, if I am writing to global variables, I need a mutex, which will block each thread which is waiting to write).

I'm new to threading. How is this normally done? Perhaps the main program could poll the threads, instead of the threads iforming the main program?

View 1 Replies


ADVERTISEMENT

Should Threads Update Global Data In The Main Program

Mar 18, 2011

I want to launch a bunch of threads, each performing the same task, and know in main() when each finishs and it if it was successful or failed.The solution offered was to use a ConcurrentQueue, but other posts have recommended using a BackgroundWorker Class, or a thread pool.Is there a definitive answer?Again, all threads perform the same code and have a pass/fail result. I want to run more than there are available threads so as soon as one thread finishes I will launch another asap - I want tehm to stress a remote systems as much as possible (reather than stressing my local PC with too many threads, so I will need to experiment to determine the optimal number of threads).

View 4 Replies

Access Database Feedback On Setup In Vb Program?

Feb 15, 2011

I am writing a program that is using a access DB for the info to be displayed. However when i started making the program i started by just databinding the listboxes.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'AcskillsDataSet.Skills' table. You

[Code]....

but now that im looking at the data this is prolly only useful for simple data. Im wanting to seperate the data from queries into multiple boxes. Am i better off just manually having a connection to the database and running queries into arrays to sort the data?? The above method looks like im going to be trying to fight the databound stuff. There are two tables and the way the built in query builder is im starting to think its easier to write my own queries in variables or whatever.

View 4 Replies

Make A Small Program For Feedback And Send It To My E-mail?

Feb 28, 2011

m using Microsoft Visual Studio Basic 2010 and im fairly new to it. Im trying to make a small program for feedback and send it to my e-mail. I have seen e-mail sender tutorials on youtube but thats not really what I am looking for. Im looking for it to be automatically sent to me, not having to type in "To" so as if its hidden I guess. So Basically

View 2 Replies

Error 3 'Sub Main' Is Declared More Than Once In 'SystemInformation': SystemInformation.Program.Main()

Jun 14, 2010

I have a solution with more than one project and the main project contains buttons to open forms from different projects that are in the same solution. Say Project1 is the main project and Project2 is the different project that gives the following error when i compile it:

Error 3 'Sub Main' is declared more than once in 'SystemInformation': SystemInformation.Program.Main(), SystemInformation.My.MyApplication.Main(Args() As String) System Information II

I have already seen other threads with this question but it does not work for me because i have more than one project.For Project2: Application Framework is disabled and the startup object is "SubMain".

View 2 Replies

Why Does A Nearly Empty VB.NET Program Use 4 Threads?

Mar 17, 2011

I just noticed after adding the threads column in task manager to Win7 that a fresh new VS2005 project with single form and no code compiles and runs with 4 threads. Does anyone else notice this? Can anyone tell me why?

View 3 Replies

Maximum Threads Usage In A Program

Jan 27, 2010

Maximum threads usage in a program

View 4 Replies

Multithreading - .NET 4.0 Execute Multiple Threads But Threads Are Completed Before Resuming?

Oct 19, 2011

I just had a new, last-minute idea on to take on a task, so I am running to StackExchange for quick help.

What I want to do is execute a series of methods right in a row, each in their own threads. I want the application to wait until all of these threads are completed, after which the program will resume. It also has to use managed threading (thread pool).

What quick examples could you provide to help me along the way? If it's too complex, what things should I know about so that I can Google it on my own?

View 1 Replies

Queue Threads - Spawn A Series Of 'child' Threads From A Loop

Dec 30, 2009

I have a main thread which is designed to be a batch processor - it spawns a series of 'child' threads from a loop (which can vary in terms of the no of items) - see below

[Code]...

However, each of the 'child' threads could take anywhere from milliseconds to about a minute to process - depending on the complexity of each calculation. There may also be a large number of child threads - e.g 100s. Creating large numbers of child threads is not efficient. I therefore want some way to effectively queue each child thread (and cancel if the process is taking too long to complete). Autoevents seems like one way of doing this, but the only examples I can find seem to assume there are two different processes on seperate threads, not one process being repeated.

View 4 Replies

Threads Program Uses To Scape List Faster?

Nov 22, 2011

Im making program that scrapes things from big url list, is it possible to make user set how many threads program uses to scape list faster? If its possible,

For each url as object in urllist.items Do something.Next If can be made into that, would be nice :P

View 9 Replies

VS 2010 - Creating New Threads From Set Amount In Program?

Jun 1, 2011

How do I make my program create new threads from a set amount? For example if someone typed "60" in a textbox and they pressed "Start", it would create 60 threads that would do the same function.

View 5 Replies

Create Multiple Threads To Improve A Function On Program

Sep 7, 2011

i need to create multiple threads to improve a function on my program. it is a simple thing really but it's slow and if multithreaded it can improve the speed some thousand times. my program uses a dll to check the MX record of an e-mail from a textbox called emails if the mx record is correct then it validates that domain, if not, it sends to an error textbox with that mail my problem is that im reading a lot on multithreading and i dont have an idea how to make something like this: for x=0 to emails.lines.count -1' start a thread that runs my function next if i can limit the number of threads to avoid crashing it would be good.

View 5 Replies

VB Program Without Main?

Mar 9, 2012

Recently i bought the book by Troelsen about VB and the net and tried to run the programs e.g.:

Module Module1
Sub Main()
EntryPoint.Main()

[code]....

I had to add the first sub "Main" otherwise it would not run. Is it possible to do without that sub in the way member OLiver does in the examples he provides?

View 9 Replies

Start Your Program From Sub Main?

Mar 11, 2010

Is there a way to start your program from the sub main() like you could with vb.net

View 4 Replies

Sub Main Missing From Program?

Jul 4, 2011

I recently started learning how to use visual basic and whenever i try and make programs (aided by microsoft tutorials), it says in the error section: Sub Main missing from (my programs name).

View 4 Replies

VS 2010 Using A Sub Main To Run Program

May 12, 2011

Is it possible to use a sub Main() to start you're application rather than a form, if so how? Also how do you implement the cmd commands such as "[application path here]program.exe colourclicker" The above command would start the program but would only show a certain form.

EDIT Is there another way other than unchecking the 'Enable Application Framework' checkbox? (As this disables XP Styles and uses the ugly classic windows styles)

View 9 Replies

Make A Program That Has A Main Form

Jun 22, 2010

Im trying to make a program that has a main form(menu form) and when i click on the buttons another separate form will appear.

View 1 Replies

Plugin Which Is Dependent On Main Program?

Jan 23, 2012

I have developed an application with a plugin architecture using interfaces. I realized that when I release the API for 3rd party plugin development, someone would be able to create a loader program to replace my main program quite easily. Is there any way I can make the plugin dependent on my main program? All my main program does is get an icon and a description of the plugin from the DLL plugin (using the interface) and then calls the dll's interface function to create and display the form.

View 2 Replies

Call Other Files That Programmed To The Main Program?

Oct 8, 2010

i want to know how can i call other files that i programmed to the main program?

View 1 Replies

Check Out The Program It Looks Like The Main Form Is Not Being Updated?

Dec 16, 2011

I have an application I've written for some of the people at work and there is one bug that I have no idea how to solve. The application is multithreaded so that the main form can be updated with new information as it comes in. Throughout execution, several other forms come up as well (one at a time).Every so often I get reports that the program freezes. When I check out the program it looks like the main form is not being updated(checkboxes are see through, textboxes are blank) and the main form can't be moved around. This only seems to happen sometimes when the program is left for long periods of time (+30 min) and only on the released .exe and never in the debugger(as of yet). I've tried leaving the program running overnight and it had no problems.

View 5 Replies

VS 2010 How To Focus(select) Main Program

Sep 15, 2010

Me.Focus() doesn't do the trick, my program is hereQuote:

Public Class Form1
Declare Auto Function mouse_event Lib "user32.dll" (ByVal dwflags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal dwData As Integer, ByVal dwExtraInfo As Integer) As

[code]......

View 2 Replies

VS 2010 Thread To Check Main Program Execution

Apr 27, 2011

I feel like the answers I seek are rather obvious so I feel silly for having to ask, but I just can't seem to figure this out (I'm new to threads, and am really only comfortable using them in Java at the moment). I have an Excel Addin application created with VB.NET, and I've noticed that occasionally while it's running some code (it's no one specific block of code) the program execution will just stop. This is especially problematic when I've set ScreenUpdating to False for Excel because the users then have to completely close out of Excel to get ScreenUpdating to true.

[Code]...

View 8 Replies

Get Results From GenerateNumbers Outputted To The Main Program To Be Used In Other Functions/procedures?

Dec 10, 2011

I'm having trouble getting this program to work.. I just cant figure out how to get results from GenerateNumbers outputted to the main program to be used in other functions/procedures.I tried

Dim Result1 As String = ThreeResults(0)
Dim Result2 As String = ThreeResults(1)
Dim Result3 As String = ThreeResults(2)

but for some reason it sets the value of each ThreeResults(x) to " "[code]......

View 1 Replies

VS 2008 - Make Program For Hooking / Inject .dll File Into Main.exe?

Apr 1, 2010

how to make program for hooking/inject .dll file into main.exe I want to make 1 program to inject/hook .dll file to main.exe fast . Its about the game MU Online.

View 2 Replies

VS 2008 - Bunch Of Errors - Main Login Box And Then Fail To Show The Main Screen

Jul 28, 2009

My app works fine on the development machine and 3 other machines. However, some machines just show the main login box and then fail to show the main screen. There is no error message. I installed VS 2008 express on on of such machines and when i compile the project, the following errors appear:

Type 'Microsoft.Office.Interop.Access.Application' is not defined.
Type 'dao.DBEngine' is not defined.

[CODE]..........................

View 3 Replies

Get Feedback From A Class

Jun 28, 2009

The background: I'm in the planning phase of an Application. The Application will work with a set of data which will be illustrated on a diagram. I plan to have a class for dealing with the graphical issues (e.g. creating the diagram plot, zooming, drawing lines on the plot, selecting a data point by clicking, etc.) These will be handled by MouseDown, MouseMove and MouseUp events.

[Code]...

View 5 Replies

Using Shell And Getting Feedback?

Oct 18, 2011

I want to be able to run any command by typing into a textbox.For example if I wanted to get info from "ipconfig".I want to be able to type "ipconfig" into the textbox and for it to then display the infomation into a richtextbox.I have been searching the internet but so far can not find a solution

Code:
Shell("ipconfig", AppWinStyle.Hide)

How do I now display the infomation from the console into a richtextbox?

View 3 Replies

2005 - 5 Buttons On The Main Page - When Click On Button It Will Install An Exe Map Program

Sep 4, 2011

I have but a vb project and i have but 5 buttons on the main page i am trying to have so when you click on the button it will install an exe map program.

View 4 Replies

ASP.NET Feedback During Long Submit

Dec 23, 2011

This is probably a really simple thing. Basically, the user clicks a button and a potentially long running task happens. I'd like to do a few things like toggle the button's enabled state, show a spinner, etc. In VB.NET Winforms I'd just do Application.DoEvents() and the updates would happen and the code can continue. How can I do this in ASP.NET? (preferable serverside or minimal javascript)

View 2 Replies

How To Create A feedback Form

Oct 14, 2011

Does anyone know of any documentations on how to create a feedback form in vb? by feedback form i mean a box which the users can type what they thought and click send which sends the text in the box to a pre-determined email address.Iv been looking around for a few hours and all iv found is contact forms which are limited to gmail email accounts?

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved