Make An Application Multithreaded?

Oct 14, 2010

After trying to make an application multithreaded, almost towards the end of the processing of 10,000 records, I get a webexception - operation timeout.Now it seems to process around 8000 records just fine, for each record it is also doing some business logic and with it, performing a call to a webservice.

without threading, its fine - no problems. with threading, we hit the issue.so there are 10,000 records to go through. this is of course slow when done in sync mode (Single threading) but much faster when placing items in the threadpool and waiting until completion.

im not sure exactly why the problem happens. how should I debug this when multithreading? its just odd that for around 3/4 of records, the calls are doing very well, then on the last bit to go, it bombs out.

again - no issues when single threading.update: seems to be after around 1000 records that have been processed that it seems to happen.the application calls out to an internal webservice which then does the direct callout to the "outside world" webservice. The internal webservice does some caching but shouldnt have any effect really.

The outside service it is calling is httpBinding. ReceiveTimeout is set to 00:10:00 (10 minutes) and bypassProxyOnLocal="false"im still not quite understanding why it would timeout after 1000 records because it seems to process the others just fine and does come back (or so it seems) when its making a call to the service

View 2 Replies


ADVERTISEMENT

Chat Application NOT MultiThreaded

Mar 16, 2012

I don't want it to be MultiThreaded. i read some tutorials and have a good idea. but unfortuantely all the tutorials on the web write code without explaining. so is anyone here has a good knowledge with Chat application ? I know it's about sockets and stuff but i just need an explaination with code ;)

View 5 Replies

Create A Multithreaded Application?

Aug 20, 2009

I am using Visual Basic 2008 Express Edition and I want to create a multithreaded application.

View 13 Replies

Managing Exception In Multithreaded Application?

Mar 20, 2009

I started throwing exceptions on a multithreaded application, and got a mess.There is a good tutorial on managing exceptions in multithreaded applications?

View 4 Replies

Multithreaded Application And Crystal Reports

Nov 16, 2009

I have developed a multithread Windows Application that requires to print various Docss/rpt's off. The problem is I get a "Load Report Failed" error message when creating a new instance of my embedded crystal report.

View 3 Replies

VS 2010 - Showing Forms On Multithreaded Application

Apr 17, 2011

I've finally gotten multi-threading working on my application, but now I'm having trouble showing forms when I need to. I currently have three threads in my program: one for updating a textbox, one for transferring files, and one for displaying forms. Here's a snippet of code from my program:

[code]...

I'm getting the error: Control 'frmXCopy' accessed from a thread other than the thread it was created on. I know what this means, but I can't find a way to make the ShowForm Sub run off of the main application thread.

View 9 Replies

Make Multithreaded App Stop At A Certain Point And Wait For The User To Type Something Into A Text Box

Sep 19, 2010

I'm trying to work out how i can make my multithreaded app stop at a certain point and wait for the user to type something into a text box and click ok. It must then carry on and when a different thread gets to that point it stops again and waits for the user to input some text again.

View 1 Replies

C# - Multithreaded Drawing In .NET?

Jul 24, 2010

(Edit: to clarify, my main goal is concurrency, but not necessarily for multi-core machines)

I'm fairly new to all concepts on concurrency, but I figured out I needed to have parallel drawing routines, for a number of reasons:

I wanted to draw different portions of a graphic separatedly (background refreshed less often than foreground, kept on a buffer). I wanted control about priority (More priority to UI responsiveness than drawing a complex graph). I wanted to have per-frame drawing calculations multithreaded. I wanted to offer cancelling for complex on-buffer drawing routines.

However, being such a beginner, my code soon looked like a mess and refactoring or bug-fixing became so awkward that I decided I need to play more with it before doing anything serious.

So, I'd like to know how to make clean, easy to mantain .NET multithreaded code that makes sense when I look at it after waking up the next day. The bigest issue I had was structuring the application so all parts talk to each other in a smart (as opposed to awkward and hacky) way.

I have a preference for sources that I can digest in my free time (e.g., not a 500+ pages treatise on concurrency) and for C#/VB.NET, up to the latest version (since I see there have been advances). Basically I want something straight to the point so I can get started by playing with the concepts on my toy projects.

View 2 Replies

Can A Shared Method Be Multithreaded

Feb 28, 2012

As the question states, can a shared method of an object be multithreaded? I don't quite having threading down in my skillset, otherwise I would test myself. On the other hand, I am involved in designing class that could be part of a multithreaded application in VB.Net.

View 3 Replies

Debugging The Multithreaded Programs?

Oct 29, 2008

I have a background thread that waits for data to come in. When data arrives, it fires off a call to the GUI thread.All works just peachy, except if there's ever a run-time exception in the GUI thread. If that happens, the debugger always halts at the point in the worker thread that called the GUI thread. It never shows the proper line that the error occured on.How do I get the debugger to stop at the error in the GUI thread?

Here's the pertinent code from the worker thread:

Code:
Public NotInheritable Class UIThreadMarshal
Private Shared _MainForm As Form = Nothing
Public Shared WriteOnly Property MainForm() As Form

[code]....

View 4 Replies

Build A Multithreaded App - Catch The Returning Value?

Dec 26, 2010

I'm trying to build a multithreaded app but I couldnt find anything on google on how to catch the value that the lambda function returns.

ThreadPool.QueueUserWorkItem(New WaitCallback(Function() As Integer
Value += 1
Return Value
End Function))

View 9 Replies

.net - Isolating Read And Write In Multithreaded

Mar 8, 2010

In a multithreaded application. I have a bunch of function that loop through a collection to read the information. I also have a bunch of function that modifies that same collection.

I'm looking for a way to isolate all the read and the write together. I don't want a write to be done while a read is in progress. I was thinking of using SyncLock on the collection object but this will block multiple read trying to work in parallel.

View 1 Replies

Send Message To All Multithreaded Clients?

Aug 2, 2010

Given the code, ss there a way to propagate messages send from any of the multithreaded chat client to all the other chat client:

First the main will call startClient:
Public Sub startClient(ByVal inClientSocket As TcpClient, _
ByVal clineNo As String)

[code]......

View 1 Replies

Sql - Stored Procedure For Multithreaded App - Timeout Expired

Jul 5, 2011

I have an application using taskfactory that creates multiple tasks which insert records into the same table in a database. I have jobs that cleanup the table when it gets too large and have the execution time-out set to 0 in options in sql server management studio. I keep getting the following error on the tasks when trying to do an insert using a stored procedure and set an exception handling process to sleep and try again. This does not help as it seems it timeouts on almost every attempt.Not sure how to handle this and ensure the table handles all these inserts. Tried including connect timeout = 600 in one of the processes connectionstring but this did not help.Also set sqlquerytimeout value in registry to 90 but still not helping.

ERROR: timeout expired the timeout period elapsed prior to completion of the operation or the server is not responding...

could not see the details of the error since visual studio 2010 debug options had to be set that way, but I will set a responsestream and capture but I rebooted sql server and somehow everything is fine now...not sure why.

Errors have reoccurred.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception,
Boolean breakConnection)

[code]....

View 1 Replies

VB 2005 - Sync Lock In Multithreaded Programs

May 16, 2010

I have been reading through lots of sample code and explainations regaurding the uses of Sync lock in multithreaded programs but still am a little fuzzy on this.

Am I correct in assuming that if I have two or more threads running the same procedure which has a sync lock on a shared resource that the first thread to call the lock will complete its update of the resource and any of the other threads to try and lock this object would just wait in line until it is released by the first object?

I am also a bit fuzzy on what is actually locked by the sync lock.

Lets say I have code that uses sync lock and the object specified is the current thread. Does that also lock the shared resources that are referenced within the sync lock block or would I need to use another method to do this?

What if my shared resourses were all in another class and I issue a sync lock on that class before I try to modify the resources would that be the proper way to go about it?

And last but not least is there any need to use sync lock when the shared resource is in effect read only [meaning the program will read the value but will not change it during runtime]

View 8 Replies

WinForms - Writing To File In MultiThreaded App Fails

Jul 11, 2011

I have a multi threaded app that writes log to file. occasionally, saving fails using this code:
Friend Sub SaveToText(ByVal FileName As String, ByVal Text As String)
'// create a writer and open the file
Dim objLock As New Object
SyncLock objLock
Dim tw As TextWriter = Nothing
[Code] .....

The error message I get:
The process cannot access the file 'error.log' because it is being used by another process.

View 1 Replies

CORRECTLY Implement A Multithreaded Progressbar During A LINQ Query?

Oct 31, 2011

I have a linq query which loads approx. 1000 lines into a variable, during that process I want to display a progressbar, not necessarily stating the percentage, can be marquee style, doesnt matter.

This progressbar is on a modal form to precent the user from interacting with the app for the time the query's running.

[Code]...

View 3 Replies

Implement Multithreaded Crawler - Add A Unique Url To Each Thread To Go Process

Feb 1, 2010

I would like to implement a mulithtreaded crawler using the single thread crawler code I have now. Basically I read the urls from a text file, take each one and crawl and parse it. I know how thread basics of creating a thread and assigning a process to it but not too sure how to implement in the following way:

I need at least 3 threads and need to assign a url to each thread from a list of urls, and then each needs to go and fetch it and parse it before adding contents to a database. [Code] Now the code maynot make sense but what I need to do is add a unique url to each thread to go process.

View 4 Replies

Multithreaded .NET (2010 Express Edition) Program Work Properly?

Sep 11, 2011

I'm trying to make a program of mine into a multithreaded application, but I've hit a pair of snags that I documented in the following code. I can expand this stub into a more efficient version of my existing application.

[Code]...

View 3 Replies

Multithreading Performance - Multithreaded On An Extreme X6800 And A New Lenovo W520

Jul 5, 2011

Id like to say that I have a disk to be searched. The same task was run was multithreaded on an extreme x6800 and a new Lenovo W520.

The filescan on the x6800 dual processor extreme searched 1788 files in 477 seconds. The same search on a new WS520 took 82 seconds to search 2149 files. Multithreading works and the X6800 has an ssd and the lenovo has a standard mechancal disk! The task was diskbound.

View 4 Replies

VS 2005 MultiThreaded Server Socket: From Console To Windows Applications?

Nov 23, 2011

I would like to make a multi-socket TCP server (to accept multiple clients at the same time).I'm working with Visual Studio 2005 Express, maybe that's why files on CodeBank don't work..I found on the web an example about MultiThreaded Server Socket programming, but this is done for "Console application" in this way:

[Code]...

View 7 Replies

VS 2008 - Multithreaded Crawler - Each Time A New Thread Accesses One Of The Lists The Content Is Changed

Mar 18, 2010

I have written a multithreaded crawler and the process is simply creating threads and having them access a list of urls to crawl. They then access the urls and parse the html content. All this seems to work fine. Now when I need to write to tables in a database is when I experience issues. I have 2 declared arraylists that will contain the content each thread parse. The first arraylist is simply the rss feed links and the other arraylist contains the different posts. I then use a for each loop to iterate one while sequentially incrementing the other and writing to the database. My problem is that each time a new thread accesses one of the lists the content is changed and this affects the iteration. I tried using nested loops but it did not work before and this works fine using a single thread.

Here is my

SyncLock dlock
For Each rsslink As String In finallinks
postlink = finalposts.Item(i)

[CODE]...

Finallinks and finalposts are the two arraylists. I did not include the rest of the code which shows the threads working but this is the essential part where my error occurs which is basically here postlink = finalposts.Item(i) i = i + 1

ERROR: index was out of range. Must be non-negative and less than the size of the collection. Parameter name:index

I tried copying it to a new list but dosent work.

View 9 Replies

VS 2008 Make One Application Send A Task To Another Application / Receive Result From That Secondary App?

Apr 26, 2010

is it possible to make one application send a task to another application and recieve the result from that secondary app?i made a text editor program and i added a scan feature and i made another app that has ocr capabilities.The scanner ability is in my text editor program, the ocr program doesnt scan you have to input an image into it and it will give text result a few seconds later.the prob is alot of times the ocr code uses sooo much memory and crashes when its incorporated with my text editor, but individually each application works fine and doesnt take too much memory. Memory wont be even an issue if the ocr program is standalone so that when it is done decoding image the application can be made to exit. now here is the question, how do i make my text editor send the image to the ocr program and how do i make my ocr program send the text back to my text editor? is it possible? i mean the only way i know off is creating temp files in a certain folder and having a timer on each program that keeps waiting for temp files. That just seems like pretty lame coding to me i was wondering if there's a better way?

View 11 Replies

Make A Hidden Application - Close Unwanted Application?

Dec 5, 2009

I want to make a Hidden Application,my application Block Unwanted software or Application

View 13 Replies

Make An External Application 'child' Of Main .Net Application

Jan 23, 2010

I use SetParent to make an external application a "child" of my Main .Net application. This works fine.What I need to know is why can't I use Me.MDIChildren(0)I thought that using SetParent would increase the number of children by 1, thus allowing me to reference it with the above code, but it shows there are no children in the array.I have been trying, without luck, for 2 days to try to maximize an external app being displayed in my app. I can get it to display, but I would love it if it could Dock to the same size as its container (a panel)

View 3 Replies

Make The Application Adaptable To The Other Computers After Making Exe Application

Dec 14, 2009

I am making a exe application and i am using mysql as my database. So the thing is, when i change to a new computer, i need to change the file path for the database connection string to that computer.

like below:

Dim connectionString As String = "Data Source=----------SQLEXPRESS;Initial Catalog=Flexlink;" & "Integrated Security=SSPI;"

i need to change the data source = --------------- SQLEXPRESS to the computer name that i am using for my project.

May i ask is there any method such that the user dont have to go in to the source code to change the computer's name like those normal installer?

Just install and the application will run according like any exe file that we buy.

View 1 Replies

MD5 Verifier - Make An Windows Application Or Just A Console Application

Aug 11, 2009

Okay so basically I want to see if I can make an windows application or just a console application in VB.NET that will verify an MD5 Checksum. I have no idea how to start this out, but I have the ideas of what I'd like to make it.

[Code]...

View 14 Replies

Reference Application.ThreadException In Application To Make An Addhandler?

Mar 22, 2011

I have been trying to reference Application.ThreadException in my application to make an addhandler, but I also am using imports growl.connector which has a growl.connector.application method. When I create my addhandler:AddHandler Application.ThreadException, AddressOf ThreadExceptionHandler

And I get "ThreadExecption is not an event of 'growl.connector.application'"

View 2 Replies

Skype4COM - Make A Skype Application Using VB - Application That I Call You?

Aug 27, 2010

I'm going to make a Skype application using Visual Basic, I use them "Skype4COM.

Below is a link on the page somewhere in the middle Skype4COM. It is the DLL that I use.

But my question is, how can I in my application that I call you? Not that you're on the phone but if someone phoned you before you've pressed record.

View 2 Replies

Make Application Working Better And Never Freeze / Make Application Working With Any Count For Loop Without Freeze

Jan 19, 2012

I'm using loop to read data from sql and then make some calculations then save it again to another table but when application loop for 3 or 4 times it's freeze but the job is done but if loop = 10 or more then it is freeze and hangup for long time .i need to learn how to make my application working better and never freeze and make application working with any count for loop without freeze .

View 7 Replies







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