Get Information About What Code Is Running In A Thread?

Sep 25, 2009

I have a Window Forms application (using clickonce installation, running on a terminal server) that occasionaly ends up with a thread that appears to be running in a tight loop. The user doesn't know this happens as the app continues to run as expected. Also I have determined that I can kill the problem thread without any apparent affect on the app.

I can use Process Explorer to find the instance of an app with the problem and can isolate the thread with the problem but haven't found any way to look into the thread to find anything that would help me determine what is causing the problem. Does anyone know of a way to some additional information about a thread, like maybe strings, that would help me zero in on the issue?

View 2 Replies


ADVERTISEMENT

Multithreading - How To Ensure That A Code Is Running On Main Thread

Jan 21, 2012

It's easy to do so in objective c but I do not know how to do so in vb.net update:I know about control.invoke. But control.invoke requires a control that may change from program to program. What would be the easier way?So yes program is winform. However I need a solution that does not depend on any specific control. If that's the case actually I do not need things to be run on main thread do I?

View 2 Replies

IDE :: Partial Class Code Behind A Dataset Object / Is It Running In A Separate Thread

Jan 27, 2010

I am instantiating a form object in my code behind the dataset just to access some form level variables and to occasionally set a label in the navigator bar. Recently in the b2 Team version of VS2010 there are some strange errors thrown in the immediate window and then I'm tossed out of debug mode and back into the IDE. This code has been operating for some time in this project without this behavior. A team member has just reproduced the behavior in his development machine also.The error that starts the shutdown of the debug instance is this: Control accessed from a thread other than the thread it was created on.

View 4 Replies

VS 2008 Thread Performance - Processor Not Running On Full Speed With The First Code?

Mar 10, 2011

Not really asking for code, but I'm interested in knowing the basics of "thread performance".For example, you try to copy a bitmap in a pixel by pixel operation. (Is slow, but it is a nice example)

[code]...

This is, of course, very buggy and causes a lot of violation errors etc. But that doesn't matter right now. How come the multi-threading way is so much faster than the regular routine? Is the processor not running on full speed with the first code, and is it working harder on the second?I find it weird to see this type of "threading performance increase", as if every single thread gets their own piece of processor speed allocated like it is a new process

View 12 Replies

Passing Data From One Running Thread To Another Running Thread?

Jan 14, 2011

I have on timer thread that needs to pass every time a different data to another running thread to make the calculations.

View 5 Replies

Waiting For Threads - Thread.join Suspend Execution Of Code On Calling Thread Until Spawned Thread Finishes Or Is Aborted

Sep 2, 2010

My understanding is that thread.join will suspend the execution of code on the calling thread until the spawned thread finishes or is aborted...

With that in mind, I tried this:

For i = 1 to 50
threads = New Thread(AddressOf test)
threads.IsBackground = True
threads.SetApartmentState(ApartmentState.STA)

[CODE]...

However, the rest of the code runs when the loop finishes, not waiting for all the spawned threads to finish. Since the rest of the code needs the threads to finish (otherwise the rest will error).

View 4 Replies

Thread Communication - Return The Information Back To The UI Thread?

Feb 20, 2011

I'm using webclient to download a webpage but obviously since it's on the UI thread it freezes.How can i change my class to be multi threaded using DownloadStringAsync? i can do this normally but since i am needing to return the information back to the UI thread i am a bit stuck

Public Class RequestExecutableInformation

Public Function FileReport(ByVal executable As String, ByVal ParameterStart As String, ByVal ParameterFinish As String) As String

Dim Source As String = String.Empty[code]...

View 6 Replies

VS 2008 Add Information To A ListView From A BackgroundWorker Thread?

Nov 30, 2009

I'm trying to add information to a ListView from a BackgroundWorker thread. I thought I could do this in this manner:

vb.net
Private Delegate Sub _ListView(ByVal lvi As ListViewItem)
Public Sub test(ByVal lvi As ListViewItem)

[Code].....

When I attempt to run the "test" sub the BackgroundWorker, I get an error:

Argument not specified for parameter 'lvi' of 'Public Syb test(lvi as System.Windows.Forms.ListViewItem)'.

Is there something I need to specify when declaring the sub, or in the sub itself?

View 8 Replies

C# - Running Class As New Thread?

Mar 5, 2009

I want to start a job in a new thread or using backgroundworker to do it but havent done that before and asking you wich way I should do it. My program has a datagridview with a list of files, one file per row. I want the user to be able to select a row and then press "Start download" to start a background job of the download. I want to get events back of the progress of the download.

I have a class clsDownload that handles everything and raises events back but how do I implement the backgroundworking?Should I use the System.ComponentModel.BackgroundWorker inside of the class or create some wrapper that handles this or use some other threading stuff?

Edit: I dont understand how to implement my download in the backgroundworker, any small example would be very nice. The example on msdn didnt get me far.I have a download class that has a StartDownload-function. Should I use the backgroundworker IN the class or in the caller? "feeling stupid"

View 5 Replies

Running A Form On Another Thread?

Apr 28, 2012

what i currently have is the main form that then when a user presses a button it runs some functions that loops through some files and changes them and then copys them to another location the functions can take quite some time. what i want to is when the button is pressed it opens another form with a textbox on it and when it has finished 1 cycle of the loop is outputs a line to the textbox and tells the user weather or not it has been sucsessfull.

at the moment i have:

Dim t As Threading.Thread
t = New Threading.Thread(AddressOf Form3.Show)
t.Start()

[Code]....

View 1 Replies

Running A Thread From Within A Webservice?

Dec 3, 2009

I have a webservice with a webmethod that accepts an XML from a client via POST (don't know if this really matters), validates XML and the data inside, and then processes the XML and returns an answer to the client.At moment, I have a problem with large XMLs; it takes too long for the XML preprocessing to finish, and the clients timeout expires.Instead of increasing the timeout of the client I thought I could maybe separate the XML validation from the XML processing by starting a new thread after the validation which processes the XML and at the same time return the validation answer to the client. (the processi

View 10 Replies

Running All Threads Not On The GUI Thread?

Dec 7, 2011

I have only managed to use an STA to run a long running excel process with a background worker and 2 delegates.

What I want to do now is have the whole application running outside of the main thread to make sure the UI is always available, I then want to create new threads from the thread I have outside of the main to run the various processes. I will need to have some form of syncronisation in there for certain things to be done once a thread is completed and also I will need to change the button states on the main form to stop certain process being called whilst other processes are running.

This is my code so far, basically this loads in a csv file to a datatable adding manager employee ID and email address, filters it and displays the resultant data in a listview. There eventually will be some filter options as well. There are then 2 options for processing the data, it will produce individual bradford factor reports and email them to each manager or will produce a summary spreadsheet that is sent to HR.

Currently because there are around 8000 lines of data, it was the summary option that required the background worker as a long running process time out error was occuring whilst in the main.

What it does is write the data from the list view to an excel sheet and colour co-ordinates the summary rows according to the absense policy. It then copied bottom to top, the summary value the next blank column against all the lines for that individual and then uses this column to decide which sheet to move the row to, copying the row to the new sheet then deleting it from the master list and shifting the cells up.


This works well, but the process of loading the data in to the list view locks up the main thread where it currently runs. I also wanted to make this slightly more complicate as far as threading is concerned, as more of a learning curve than a practical application of the function.

Here is my code so far: [URL]

View 10 Replies

Expose Information About A Running .NET Exe?

Jun 6, 2010

I have a .NET exe that I wrote and it has a couple properties that I made public and want to expose.

I want to shell this exe (Process.Start()) and then somehow reference this exe and get access to these public properties. These properties expose information about the running exe.

I know how to shell to the exe. And I know how to add a reference to the exe from my project that I want to use this object. But how do I get access to the properties of this running exe?

If you do know the answer maybe you could just tell me what the standard method is to expose properties of a running exe to another application at run-time.

View 5 Replies

Raise Information State Value From A Function Call In A Thread

Mar 4, 2012

I'm calling a class function in a thread function. I'm using invoke method to send a value to a progressbar in the main form and I don't know how to do that in an other class function called by the thread function.

My goal is to send a value to a progressbar to the main form from the thread function and even from the function called by the thread function.

My code:
' Invoke sub
Public Sub UpdPgEvent(ByVal value As Integer)
Me.pgFindEvent.Value = value

[Code]....

View 1 Replies

BackgroundWorker Get Values From UI Thread While It Is Running?

Jan 2, 2012

I am using the BackgroundWorker to do the heavy tasks so the UI thread doesn't get blocked. While the BackgroundWorker can send values to the UI thread using the progress-scheme, how can the BackgroundWorker get some values FROM the UI thread?

Either by asking it or simply by the UI thread sending some values to the BackgroundWorker?

Just accessing a variable of the UI thread like UIForm.x within the BackgroundWorker does not work, it does not seem to have access to the UI variables?

View 1 Replies

C# - Dump StackTrace For Each Thread Running

Feb 1, 2011

Is there a way in .NET (VB.NET or C#), when an exception happens, to dump the stacktrace of each thread? Basically I would like to reproduce what happens in Visual Studio's Debug->Threads window to see what each thread was doing when the exception happened

View 2 Replies

Can Immediately Stop A Thread From Running .NET

May 25, 2011

I have the following code running in a thread to enumerate the local machines in the active directory. This takes some time to complete (about 5-10 seconds) so if the user quits the application before the enum is complete the application takes 5-10 seconds to quit. I tried thread.abort but because it is waiting for For Each SubChildEntry In SubParentEntry.Children to complete it doesn't abort until this returns.

Dim childEntry As DirectoryEntry = Nothing
Dim ParentEntry As New DirectoryEntry
ParentEntry.Path = "WinNT:"

[code].....

View 2 Replies

Closing A Form Running In A Different Thread

Sep 6, 2011

I have form1 and form2. A button on Form1 calls a thread background process (below). That process processes the command and when its done should close form2. I'm opening form2 within the current thread but trying to close it in the background thread. This is because if i close it in the current thread it closes immediately. I included the 2 functions below and what I have tried in the inline comments. Form2 is a simple form, basically just an animated gif. It is to show the user that something is happening(like a status bar) then close when its complete. I tried running different priorities instead of different threads but due to the results threading seems to behave the best. I'd like to keep access to both forms during the process, the pc, and screen refreshes realtime.[code]

View 2 Replies

Communications :: Running UDPClient Within A Thread

Jun 15, 2009

I'm trying to use a UDPClient object to listen for all connections on a specific port. Devices on my network let me know when there is new data available so I can begin processing the new data, but I need to loop within a thread in order to continually look for new data. This is understandably a resource hog, and it takes up approximately 50% of my CPU load while running.

[Code]...

View 1 Replies

Multithreading - Running A Thread From Within A .net Webservice?

Oct 17, 2010

I have a webservice with a webmethod that accepts an XML from a client via POST (don't know if this really matters), validates XML and the data inside, and then processes the XML and returns an answer to the client.At moment, I have a problem with large XMLs; it takes too long for the XML preprocessing to finish, and the clients timeout expires.

Instead of increasing the timeout of the client I thought I could maybe separate the XML validation from the XML processing by starting a new thread after the validation which processes the XML and at the same time return the validation answer to the client. (the processing won't start if the XML is not valid.

Now my question is: Will opening the new thread increase memory usage? normally I would guess it will (for normal applications) but here I am returning an answer to the client and essentially ending the process of the main thread.

Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel

[code]....

View 1 Replies

Running A Progress Bar On A Separate Thread?

Apr 11, 2012

I've made an application which goes through a long procedure when a button is clicked. I don't want the user to think the program has frozen, so I'd like to add a marquee progress bar just to show that it's still running. However, if I simply add the progress bar and make it visible when the button is clicked, the bar will appear but freeze and wait for the procedure to finish before it starts scrolling.

I know this is due to both the procedure and the progress bar running on the same thread, but the tutorials I've seen on getting a process to run on another thread seem confusing. What is the simple way to make a progress bar run on a separate thread?

View 12 Replies

Running Function In A Separate Thread

Mar 31, 2011

when trying to run a function in a separate thread, my reason for trying this is because since the application is only run on one thread, the GUI hangs when the function is called.[code]In this code, the Print screen Button is pressed and the function HookCallBack is called.The problem is that the function has variables that need to be passed and returned, and while searching, i found a website that had an answer for this, and it required the function to be put in a class, and then it could be run on a separate thread while still passing all the variables needed.url...But the code cannot be placed in a class without giving errors and it seems to me like i did something wrong. The code is meant to be used in a form and not a class.My question is, how would i go about running the HookCallBack Function in a Separate thread?

View 5 Replies

Running Process In Separate Thread

Mar 24, 2009

Here's the problem I am trying to solve. My program can export a file as a pdf. and other formats. I can open the file using process.start. My file doesnt have a good name so I am using a GUID as a name.

[Code]...

View 2 Replies

UI Freezes Though I'm Running My Sub On A Separate Thread

Aug 11, 2011

I'm working on a checksum tool, which loads all the files in a specific folder to a listview then, calculates the hash value of each file and save it to a text file.Ok, everything is working properly except for the calculation, when I start it on a separate the my UI freezes.[code]...

View 5 Replies

VS 2008 Running A Thread In The Background?

Jun 9, 2009

Im trying to run a thread in the background. The sub would take a string as as input and the text to speech object would read the string.

1st problem is: How do I pass my value strIn to my sub SpeekEventWorker when im calling it like this

[code]...

View 10 Replies

[2008] Running In Main Thread?

Mar 2, 2009

Well basically I have something being done in a new thread and I would like to start a sub not in the same thread, but in the main thread. How do I do that?

View 3 Replies

Get Object Information In A Running Process?

Jul 9, 2010

I have a vb.net application which runs as a service. I also have another Windows application that serves as the service interface.In brief the service watches some folders for new files and imports them into various databases. In the service I have an class called 'importFile' containing basic properties such as 'FileName' and 'ImportStatus'. With each new incoming file I create a new instance of 'importFile' and add it to a list object called myFiles which is of the type: List (of importFile).Currently in my service im writing a few object details (such as ImportStatus) to an XML config file which is in turn read by the service interface application. I want to expose more information from the service to the interface, and communicating via xml doesn't feel like its the most efficient method.My question is how do I expose live objects, such as 'myFiles' in my service to my interface application? I think this can be done via the Process class but all my efforts have so far failed.I'm thinking that the solution may look something like the following, but im not too sure what im doing and could be way off:

View 1 Replies

How To Make Shortcut Key To Stop Thread When Running

Dec 27, 2009

I'm currently making a bot that points and clicks. It works great! The only problem I have is stopping the bot.How could I make a shortcut key that stops the bot while it's running?

View 14 Replies

Running Threads In Thread.Pool Sequential?

May 19, 2012

I have several threads in my WinForm and I am running them via Thread.Pool, what I need to know is that how can I run them sequentially.

example:

Thread1 => me.label1.text = "Thread1"
Thread2 => me.label2.text = "Thread2"
Thread3 => me.label3.text = "Thread3"

In my Form_Load event, I have a line as follows:

[Code]...

View 8 Replies

VS 2008 Know When A Thread Is Completed Running It's Task?

Nov 6, 2010

How would i know when a thread is completed running it's task? I mean in background worker it has a completed event, but can i make something similar to that?

View 7 Replies







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