I am trying to create a proxy checker. This is my first attempt at multithreading and it's not going so well, the threads seem to be waiting for one to complete before initializing the next.
I'm using the following code to check http proxies;
Try Dim proxy As New WebProxy(getIP(addr), getPort(addr)) Dim request As HttpWebRequest = DirectCast(WebRequest.Create("http://google.com"), HttpWebRequest) request.Timeout = NumericUpDown1.Value * 1000 request.Proxy = proxy 'Proxy to use. Dim response As HttpWebResponse = DirectCast(request.GetResponse, HttpWebResponse) If request.HaveResponse = True Then
[Code]...
I am not following any tutorials I was trying to do this without help, but I need some now. Am I not using the correct code to do the job?
I'm trying to run a multi-threaded console app in VB and am having thread cross-over. Basically I want to run 5 threads, have them continually access a queue, process, and repeat until there's nothing left. When all threads have processed I want them to do something else.I'm attempting to use SyncLock to prevent multiple threads from accessing but it does not seem to be working.[code]
I'm trying to teach myself how to create multi-threaded applications in Visual Basic Express 2008. I found a page headed "Creating Threads and Passing Data at Start Time" in the Library here -
[url]
However, I can't get any of the examples on that page to run. I pasted the code from an example into a new Project in my IDE but pressing F5 just gives me build errors which I have no idea how to resolve. It's probably something trivial but I can't progress with these examples. Please can somebody tell me what I need to add to get them to run
I am drawing five images in a row. The five are the same thing at five different zoom levels. Therefore, only one of the five will be displayed at any one time, but the others have to be there because there can be over 100 images being displayed on the screen at any one time, and each drawing is quite complicated. If I were to draw them all on the fly, then zooming would require that all 115 images be recreated and redrawn with each zoom. That's painful. To avoid that, I draw all five zoom levels of each image. When the user iteracts with the form, they will be interacting with, at most, two of the images, so when they interact with the form, only two of the 115 have to be redrawn, though those two have to have all five zoom levels drawn, for a total of 10 images.
I've just completed my first multi-threaded task under windows. Historically I am a VMS Engineer. You could multithread in drivers in VMS but VMS never had formalized threads. Which means it never had applications threads. Threads will become increasing important in the future. I thought this maybe a good time to discuss them. Not having access to sources hurts in terms of the amount of depth one can achieve in Windows. Some of the topics for this thread might be...compute resource regulation, how to do multi-threading and of course things to watch out for.
I have written a rather complex dll for processing a large volume of data (~4,000,000 records) from an Oracle database. It works well, but takes about 23 hours to run.Since I wrote the code fairly compartmentalized I realized that there are 6 routines that should be able to run concurrently, and I have a multi core processor,I decided to try my first multi-threaded implementation.
In the routine I am working on I am doing no I/O everything is in memory in variables. My data is already in dataTables and hashTables. Most of the data is defined as private in the class scope, but no conflicting updates should happen because the code segments works very distinct portions of the dataTables.The concept is simple, I have 2 routines that need to complete before launching my threads, and one routine that needs to run after all of the threads have completed. Here is what I am trying;
ProcessDXDate() ProcessHistology() aryThreads(0) = New Threading.Thread(AddressOf ProcessLaterality)[code].....
I'm using VB.NET. I want to build a large List (Of MyClassOrStructure) that becomes static after its initial population.I'm going to have multiple threads that need to iterate through this list to read data (no writing, inserting, or deleting)
Are there any very bad things that I need to keep an eye out for?
I am running a class(gamepad handler) that uses many child threads to check for key input and the like then it raises events to my form to sort out the needed reaction, Is there a way to make the event raises on the same thread as the class itself.
I'm having some trouble creating a multi-client server / client thingy.So far, I've used Atheist's example and allowed the clients to successfully transmit information.However, whenever I send more than 1 message to the server at the same time, the server bugs up and does not receive the message at all. I suspect it has something to do with the DoRead method reading from both clients and stuffing it up or something.
how to re-write my application (http:[url]....) to be multi-threaded using the background worker. The use case is something like:
1. User opens a binary file, it can be several Gbytes in size so reading it into memory isn't practical.
2. User can then navigate through the file in 188byte chunks, data is read from disk, decoded, and displayed for each chunk in turn.
3. User may want to search for some data or build a report. This will involve repeating the read, decode, display, function multiple times. During this looping the GUI stops responding and there is no option to cancel so I want to make it multi-threaded. So, is it safe to open the file in the GUI thread and then read from the file in the background thread? I currently use something like this to open the file once:
Dim fi As New FileInfo(filepath) fs = fi.OpenRead() and then in a separate sub multiple calls to:[code]..........
I've got a multi-threaded app - that is using a global COLLECTION of objects.I'm starting to think that objects - when copied to objects - are really just reference pointers to the "single object" in memory - as they would be in JAVASCRIPT (too many languages At any rate - this code - when taking the object from the collection to work with is it making a new object to play with or is it working the single object that actually resides in the collection?
I have an application with 4 threads. (GUI, Controller, Producer, Consumer) The GUI is self-explanatory. The controller starts the producer and consumer threads after some intial setup. The producer creates items and places them in a free slot in a "ring buffer". The consumer takes items from the "ring buffer" and writes them to disk. The producer creates items at a much higher rate than the consumer. The consumer is IO heavy and IO bound. Currently I am checking a variable in each ring buffer slot to determine if it can be written to.
if Slot.Free then Write Slot.Data To Disk end if
I am not using lock/synclock instead I'm just reading / writing the value of the slot's "free" variable. I don't believe that is correct even though it is a volatile read/write. Is there a better method to read/write this variable? The variable is of type "integer" and is either 0 or 1.
I've been writing multi-threaded applications for a couple of years and have started reading about the Task class. It looks like it handles mutex and synchronous/asynchronous threading in an easier to follow fashion. I was just wondering if you the community likes writing threads the old way or the 4.0 tasking applications. Lastly, I thought multi-threading was parallel computing. But I was reading that there are special task etc. parallel functions.
I have a console application (VB.NET). When it is started, it spawns worker threads to find work in the database and do the task, then look for the next task (A workflow basically).
The problem that I have is that I have my Event Handler in the main thread that spawns the worker threads. Those workers, if they error, raise an event to a public delegate. However my main thread is not detecting these events, and I cannot figure out how to make it. My intention is to do all logging (text/database), email alerts, and restarting the worker to find another task that is not errored. (This will be expanded in the LogErrorMessage routine and such, for now I am just keeping it a simple Console.Writeline so that I can see if the method is being fired or not)
Here is the code around what I am trying to do:
Logger Class:
Public Delegate Sub LogDelegateError(ByVal Ex As Exception) Public Class EventLogger Public Event EventError As LogDelegateError
I am usng a multi threaded process to fire off a task, but when it is completed I want to make a label visible on the main form (form 1), eg "process completed", however the code I have in place comes up with the following error message;
Cross-thread operation not valid: Control 'lblCompleted' accessed from a thread other than the thread it was created on.
My application takes the currently logged-in user and uses an a DirectoryServices.DirectorySearcher to pull a few additional detail about them (some properties we have stored in a few custom AD fields, as well as their email address). This works great, though I've always though it was a little slow - my single-threaded code could only make about 2-3 requests/second to AD.
The real problem came when I moved this code to a web server. With multiple simultaneous users, the number of requests/second jumps greatly, and the LSASS.EXE process pegs on my server. I've checked the domain controllers, and they're just fine - the bottleneck is clearly on the application side. I suspect that what's slowing my down is the NTLM/Kerberos challenge/response, and the number of simultaneous requests pegs even the multi-core processor.
Our network policy doesn't allow anonymous reads from AD, so that choice is out. Also, I've tried every member of "AuthenticationTypes" (in the example, I'm using .FastBind), but they all seem to have about the same throughput rate with the same load on the processor.how I might work around this restriction and lower my demands on the processor? Here is the code I'm using - pretty straightforward:
Dim sPath As String = "LDAP://" & stringUserDN Dim entry As New DirectoryEntry(sPath) entry.AuthenticationType = AuthenticationTypes.FastBind[code]......
I have an Excel based algo-trading app that needs to take in lots of real-time data, and make trading decisions based on the calculations driven by the data. It is not one of those "read-only" stock ticker kinda spreadsheets.I created a COM object with VB.NET that runs in its own thread space which collects data from a socket, and when the data is read it raises an Event with data attached. In Excel VBA, the event handler parses the data, puts them to the right places on the spreadsheet to feed calculations (so far it sounds like a stock ticker app), and then, based on the results of the various calculations it does something.The problem is that when the user starts to click around the spreadsheet while there is large amount of data coming, the event handler's cell updating breaks apart. If the app is left alone without user action, it stands well. My frustration comes from not understanding what happens to the main thread when a user clicks around. Either the event handler blocks the user action, or the user action blocks the event handler (under which case I will put in some queuing facility). But I just don't see how user action can break the code (like causing VBA to stop executing)
I'm using the MAPI code by Dave Brooks.I am attempting to programatically send out a Crystal Report that is generated.When I run through the code without threading everything runs fine. The problem is when I use threading I get the return error "General MAPI failure [2]".I have never used threading before and understand that there are dangers involved. Can anyone provide any insight into this issue? NOTE: I've removed exception handling to make the code clearer.[code]
I have a solution in VS 2008 that creates a DLL. I then use that DLL in another application. If I go in to the DLL projects property pages and change the following configuration for a DEBUG build then the built dll no long provides the desired functionality. If I change it back and rebuild the DLL, then the DLL does provide the correct functionality:
I need to create a a palindrome checker program. Now I know how to check a simple palindrome by using the reverse method however I am unsure if the palindrome had special characters or spaces. My question is what is the code for removing spaces and special characters from a string using loops and if statements. Also we cannot use arrays.
I noticed in one of your forums somebody had created a web Browser with a built in proxy. What does that mean and how did you do it - I'm coding a web browser myself.
I have been trying to generate a Proxy class in VB.NET using a WSDL file for an Apache Axis SOAP Web Service. They have provided me the WSDL file and when I use the WSDL.exe command (In Visual Studio 08) and point it to the local path I get an error. wsdl /language:vb c:Orders.wsdl (I am trying to create a .NET Client that consumes the SOAP Web Service Hosted on Apache Axis 2)
The Error Unable to import binding 'OrdersSoapBinding' from namespace 'urn:company:orders:schemas:OrderTypes:1.00'. -Unable to import operation 'placeOrder' -The element 'urn:company:remtp:schemas:PlaceOrderRequest:1.00:PlaceOrderRequest' is missing If I use the svcutil.exe I also get an error message... svcutil.exe C:Orders.wsdl /t:code /l:VB /o:"C:Orders.VB"
I'm making a application to use in college to retrieve my calendar and other things in VB.NET. But my college uses a proxy so when I connect my laptop I need to change the internet settings in my web browser to view web pages. how I would send requests via a proxy server in VB.NET? Or is there a piece of software that I can download which tunnels all connections or is there a setting in win7 does this?
I'd like to set the proxy for a web request. However, when I say, for example, request.proxy = "x.x.x.x:xxxxx", it gives me the error "String cannot be converted to webproxy". How can I get around this and actually set the proxy?
How do I create a multi dimensional array in visual basic. For example I have a soccer team with players. Each player has an id, first name, last name, address, phone number. How would I represent this using a multi dimensional array?