2 Threads Not Working In Parallel?
Sep 28, 2010
I have 2 threads in my Program. Here is code for both of them
Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
[Code]...
StartReceiving is working fine but StartWriting is called only once and that msgbox in startWriting is never called, any suggestions on this
View 7 Replies
ADVERTISEMENT
Oct 27, 2010
With threads and parallel processes you can process raw data but notcontrolsUielements) because they belong to another thread,
View 1 Replies
Feb 12, 2010
I prepare data to be processed, and saved to file. Since this process is slow, I want to delegate it to a parallel thread, so the main routine can end his work faster. The data is processed and saved to file by the "Sub ProcesarDatos", a routine on his instance of "FileProcessor class".
I call the code this way:
Dim
fp As
New
FileProcessor(DatosDeArchivo, Archivo & ".txt", Me)
ThreadPool.QueueUserWorkItem
(NewSystem.Threading.WaitCallback _
AddressOffp.ProcesarDatos))
View 2 Replies
Jan 9, 2010
Public Class ThreadSearch
Inherits frmStDetails 'Windows form which contains my control
Public Event finishedSearching()[code].....
This is the procedure I used to start the thread. It doesn't generates error but the problem is 'IT DOES NOTHING'.
View 9 Replies
Feb 11, 2010
I have a web app that I'm writing in asp.net, with vb code behind. The threads were working well when I had all my code in the aspx.vb code behind files, but after I moved the code into a seperate Class.vb file, the threads don't seem to be working in parallel any more. Below is a small section of my code.
It used to be that when the "botThread.Start()" method was called, the page would redirect to success.aspx, and work on the SQL query (RunBots()) thread in the background. Now when botThread.Start() is called, the page doesn't redirect to success.aspx until AFTER the RunBots() sub has been completed.
View 2 Replies
Jan 16, 2012
I have a service that scans network folders using a parallel.for method. However recently I am finding if I stop the service then while windows says the service is stopped the process is still running in task manager. However it is at 0 cpu and the memory does not change. If I try and end the task (even a force in command prompt) it just says access denied and i have to reboot the server. What would be the best way to make sure everything terminates? I thought of adding a global Boolean that in the stop procedure it turns true and part of my parallel code will check for that and call s.stop.
View 1 Replies
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
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
Dec 2, 2010
im using tasks parallel library in .net 4.0 i want to have the ability to specify a task for each core independant of the other cores. usually in TPL, i create a task and i tell it to run in parallel, i have no control over the number of threads created nor can i control the number of cores to participate in the parallel task. also, i cant specify each particular core a different task.i'd like to know how to achieve this in TPL if it is possible.
View 3 Replies
Nov 11, 2009
Is there any way of doing parallel processing in VB.net. Like running a IF-ELSE and CASE in parallel.
For example i'm incrementing a counter in a IF-ELSE statement. And for each count i need to display some thing using a case statement.
View 11 Replies
Apr 15, 2010
tell how to form this to the correct Syntax?ere the sample in sequential form:ForEach ctrl AsCheckBoxIn tblCKBoxCollection.Controlsctrl.Checked =
View 1 Replies
Mar 31, 2011
I have been reading up on the parallel programming and even now still a little confused on the whole concepts. Lets say I have a single project with about 5 classes that interact and have local variables in methods and variables accessible to all methods in a single class and even 1 or 2 variables accessible to all classes accessed through instantiation. Now using threads I know that global variables would be overridden by multiple threads if there were no locking applied but local variables to a method/function do not, right?
So if I ran the project multiple times meaning as a new process, the methods and variables would be thread safe right and no data corruption occurs? So to implement parallel programming using the task factory, if I created a project that basically creates tasks and each task is basically running an instance of another project, then shouldn't the variables and data be thread safe and safe from corruption? But what if I had the output files and they named by Output & datetime.now.tostring, would there be conflict issues and I ask this knowing that I have seen this happen when trying it. [Code]
View 1 Replies
Jul 13, 2010
I have this sub :
Private Sub error_out(ByVal line As Integer, ByVal err_col As Integer, ByVal err_msg As String)
Dim ln = t_erori.Rows.Add
[Code]....
I suspect this is because it's trying to add the same row twice.
How can i make this work ? Or what else method could I use to do this ?
I need this datatable because my app is writing some results in there, but any other method to store the results that works with parallel.for would be ok.
View 2 Replies
Nov 26, 2010
I have a class written in C#. In it I want to run a certain function in parallel on a list. After it completes on each item I would like to update a progress bar. However, I get very odd behavior from my program. It executes the event and reaches my sub but never proceeds to actually execute any code. Instead it just freezes. (I've mixed vb.net and c#. It will be rewritten at some point)[code]So for some reason I get it to enter progressBar Counter on each item in the list but it never exists. Instead it just keeps the form frozen.
View 2 Replies
Jan 11, 2011
Im trying to learn how to use a Parallel.For loop. Ive got a big for loop, that i need to run parallel, and am trying to use a Parallel.For loop for the first time. When I try using this code, I get that it cant be called using these arguments. The old way to write this would be:[code]I dont need to return anything to the for loop, Im just trying to iterate m, running in parallel. Where am I going wrong?
View 5 Replies
Dec 31, 2008
I use the following code to print to the receipt printer on the parallel port in vb 6.0, but it seems that it doesn't work on vb.net.[code]...
View 2 Replies
Mar 15, 2012
I have two System.Windows.Forms.Timer with different interval having [code]...
but some timer2 not start wroking until timer1 not get finished i want them to run parallel without waiting for each other to finish
View 2 Replies
Mar 13, 2012
how can i sort too parallel arrays?
[Code]....
Those are the two arrays now when i try array.sort(strflavor,decamountsold) or array.sort(decamountsold,strflavor) they are not arraigned properly. I am trying to get them to sort by which flavor sold the least and which flavor sold the most. However when i sort them, the flavors are not matching up with the decimal values.
View 8 Replies
May 26, 2010
i am trying to make a robot that i can talk to(not yet) and tell it to goto places 1st task it to figure out how to use an inbuilt webcam in my net book and do an image Recognition for walls stars eg 2nd task is to see if i can get it to use my server to help compute the images because my net book is very slow 3rd is speech to text now can all of these be done in vb.net?
View 2 Replies
Aug 3, 2010
I recently changed a For Each loop to a Parallel.ForEach loop. I'm concerned about an object being declared outside the loop but assigned while iterating in the loop. Here is the simplified code.
Dim results As ModelResults
Dim noResultsModel As New List(Of ModelResults)
Dim lock As New Object
Parallel.ForEach(_modelEngines,
Sub(model)
[Code]...
Is there a potential race condition with the results object? Would anything be different if I moved the declaration of results into the for loop?
View 1 Replies
Dec 20, 2010
is there any other way to access a serial port using visual basic.net 2010? i followed the steps in this site, How to access serial and parallel ports by using Visual Basic .NET but i just got this output Open the serial port. Send the attention command to the modem. Wait for data to come back to the serial port...
[Code]...
View 2 Replies
Aug 22, 2011
if there's any overload that would allow me to specify a step size in a Parallel.For loop?
View 1 Replies
Jul 14, 2011
How to call the parallel port with vb codes.I'm going to make a helicopter to control with my pc.
View 3 Replies
Nov 5, 2011
I just learned basic arrays, I'm writing a program the allows Professor Carver to display a grade based on the number of possible points he enters in the inputbox (strMax). Then the user enters the points he earned in the textbox (dblPoints)
Then I solve the percentage. dblResults = dblPoints/CDbl(strMax) The first step is to store the minimum percentage points in one dimensional array. I did that. The second step is to store the grades in one dimensional array. I did that. The arrays should be parallel arrays. Having trouble with it It then should display the corresponding grade from the strGrades array Not done. I'm having trouble to display arrays in that are parallel.
[Code]...
View 6 Replies
May 31, 2010
i want to work with it in vb. 1st i want to check if port is already mapped or not, if not then map it and once done remove the mapping. The one way is using shell and pass command in it, but not sure how to get already map status and also wondering if there is any other method to get it done.n :)
View 1 Replies
Apr 24, 2012
I have a program that connect to 2 printers at the same time. Ribbon Printer and Label printer.
I have set the ribbon printer to be the default printer of the server so that normal document printing can be printed using it. This is very simple and i already finsih the code for it.
However i have a Parallel printer at Port LPT1 which i wish to use it to print label. I have search online but find no solution on how to open connection to LPT1 and print the document in coding.What i can find i only send a window command to the port LPT
View 1 Replies
Feb 17, 2011
I am trying to convert the code below into a parallel loop. What is the proper syntax to use Parallel.ForEach instead of just ForEach?
For Each grow As GridViewRow In gvEmployees.Rows
SendSummaryReport(grow)
Next
View 2 Replies
Jul 29, 2009
I'm deploying a standalone application (VB 2005 w/ Crystal Reports) using ClickOnce. My users have different IP addresses that they use to map to the same networked drive. The best way I've come up with to get the installer out to them is to publish it twice manually:
ip.addr.number.001/PublishedHere/001/setup.exe
ip.addr.number.002/PublishedHere/002/setup.exe
And telling them to execute the appropriate installer.
View 1 Replies
Feb 3, 2010
getting started with creating an index search for parallel arrays. When the user enters the specific "code", and presses enter, the information in the other arrays should be displayed based on its matching index. I'm pretty sure I use "For i = " but I'm lost. I have my arrays set up like this:
Dim code(9) As String
code(0) = "A"
code(1) = "H"
[code]....
View 3 Replies
Dec 29, 2010
i need to interface an spi analog switches using either a parallel or serial port. Is this possible?
View 1 Replies