.net - Simultaneous Threads Only One Seems To Function At A Time?

Mar 17, 2011

Threads a + b, (both are trying to delete files).a gets called first, then b while a is still running.b deletes the file successfully but a doesn't.If I run a on its own, a's file deletes fine.

When I step through the code I can see that a's MultiAttemptFilename gets overwritten with b's.

I don't understand.I have an ajax call pointing to a generic handler which passes the filename along with it.In my handler I have the following code:

[Code]...

View 1 Replies


ADVERTISEMENT

Make A Simultaneous Connection To Multiple Servers With Threads?

Mar 15, 2010

I want to make a simultaneous connection to multiple servers with threads, only to create a single connection.

Imports System.IO
Imports System.Net.Sockets
Imports System.Text

[Code].....

View 5 Replies

Execute Multiple Scripts At Same Time, Running On Own Threads?

May 6, 2009

I'm writing a scripter using VBScript, that should be able to execute multiple scripts at same time, running on own threads.
The issue is, I DO start those scripts on different threads, but their sleeps still seem to affect the other threads too.

For example, let's say I start 2 scripts

In the Main event
NewScript1
NewScript2

[code]....

View 1 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

Function Accessed By Multiple Threads With Parameter Passed By Reference

Apr 29, 2011

I am in vb.net and have a function that will be accessed by multiple threads. Everything inside the function uses local variables. However, each thread will pass in its own dataset by reference. From what I have read the local variables should be no problem, but I think the dataset coming in is a concern. How should I control access / execution of this function to make sure that it is thread safe?

View 1 Replies

Shared Functions - Two Threads Both Calling A Normal Function At The Same That Appends Strings

Dec 6, 2009

If I have two threads both calling a normal function at the same that appends strings, sometime the output string is a combination from both threads as the function had not finished executing the code before it was called again... Would a shared function wait to finish first?

View 9 Replies

.net - Multithreading Function To Implement Threads Fetching From A List Of Urls To Parse Content?

Feb 2, 2010

I have the following multithreading function to implement threads fetching from a list of urls to parse content. The code was suggested by a user and I just want to know if this is an efficient way of implementing what I need to do. I am running the code now and getting errors on all functions that worked fine doing single thread.for example now for the list that I use to check visited urls; I am getting the 'argumentoutofrangeexception - capacity was less than the current size'/Does everything now need to be synchronized?

Dim startwatch As New Stopwatch
Dim elapsedTime As Long = 0
Dim urlCompleteList As String = String.Empty

[code]...

View 2 Replies

Now() Function Returns Date And Time Which Is Different From System Time

Nov 24, 2009

The Now() function in VB.NET returns date and time which is different from the system time that I see on the right-bottom on the notification bar. It is 15 hours slower than the system time. Has anyone ever met this problem? I'm using .NET 2.0.

View 2 Replies

VS 2008 What Will Happen When 3 Function Calls Same Function At A Time

Apr 27, 2009

What will happen when 3 function calls same function at a time? I have 3 Function, f1,f2,f3.. Those function after completing their task will call finish() function. What will happen if Finish is Called morethan once..

View 9 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

Achieve Simultaneous File Download?

May 23, 2011

I have a class that uses a BackGroundWorker to download a single file using HttpWebRequest and HttpWebResponse

Downloading single file works.

But if I make two objects of that class and start downloading 2 different files simultaneously, there is nothing produced. Execution exits after getResponse() without any error or exception.

Is there any way to achieve simultaneous file download?

View 6 Replies

Allowing Simultaneous Access To Database For Two Different Applications?

Jul 31, 2009

I am developing desktop search engine. For that i am maintaining indexed database with file name and their path. The indexed database is created at once by scanning all hard disk. This indexed database is further updated when user creates, deletes or renames file. The updation task is carried out by an windows service application and for searching files on hard disk I have created another windows aplication. The problem is that when windows service is updating database, windows application can not read database. It gives error 'Cannot open user default database. Login failed.Login failed for user 'WINXPSwapni'.

View 1 Replies

Set The Max Amount Of Simultaneous Connections From The Smtpclient To The Mailserver?

Apr 7, 2009

I've this small application I've built which loops thru our database and generates 30000 mails and sends them using System.Net.SmtpClient, but it's not working very well. At times it won't send for a couple of minutes, all in all it takes about 48 hours for all the mails to be sent. Our mail provider says it's because the mail server can only handle 10 connections simultaneuosly and that would be the reason why it halts. I've looked over the SmtpClient class but can't find any property to set max amount of connections. Does this problem sound familiar? Could that be the reason? If so, is it possible to set the max amount of simultaneous connections from the smtpclient to the mailserver?

View 4 Replies

Keydown Event - 2 Simultaneous Key Presses Initiating Two Different Actions?

Aug 10, 2011

is it possible to have 2 simultaneous key presses with the keydown event. I have a keydown sub with 2 sets of keys mapped to move 2 different pictureboxes. But when I press a key for the other picturebox, the first one stops moving. How do I get both to work at the same time?

View 8 Replies

Pattern For Limiting Number Of Simultaneous Asynchronous Calls?

Apr 9, 2010

I need to retrieve multiple objects from an external system. The external system supports multiple simultaneous requests (i.e. threads), but it is possible to flood the external system - therefore I want to be able to retrieve multiple objects asynchronously, but I want to be able to throttle the number of simultaneous async requests. i.e. I need to retrieve 100 items, but don't want to be retrieving more than 25 of them at once. When each request of the 25 completes, I want to trigger another retrieval, and once they are all complete I want to return all of the results in the order they were requested (i.e. there is no point returning the results until the entire call is returned). Are there any recommended patterns for this sort of thing?

[Code]...

View 2 Replies

Process.Start Only Starts Up To 23 Simultaneous Processes From A Service On XP?

Oct 22, 2009

I have a service that needs to run several independent processes, my problem is that it only creates up to 23, from the 24th and so on the processes are not started and a DW20.EXE window error is displayed, it only says that the there has been an unhandled exception and that the proceess is going to be closed. Inside the process.start block there is no error so I guess it could be some limitation somewhere.

[Code]...

View 3 Replies

Sql Server - SSRS Code Shared Variables And Simultaneous Report Execution?

Dec 28, 2009

I've found out that if two instances of an SSRS report run at the same time, any Code variables declared at the class level (not inside a function) can collide. I suspect this may be the cause of our report failures and I'm working up a potential fix.The reason we're using the Code portion of SSRS at all is for things like custom group and page header calculation. The code is called from expressions in TextBoxes and returns what the current label should be. The code needs to maintain state to remember what the last header value was in order return it when unknown or to store the new header value for reuse

View 11 Replies

Two Function Executing At A Time?

Jul 1, 2011

There are two location one main form and other is communication class which use comport to send command.Everything is good in VB6 but same code fails in vb.net actually program behavior is really different.in vb6 one function execute at a time but in vb.net it execute two function at a timeeg. In form there is function to write command over comport once command is posted one event is raised by serial port in this function byte array is formed and the statement immediate next to raise_event use this array to show on formbut when event is raised control is toggle between first function and event function it execute one statement from second(COMMUNICATION CLASS) function and one statement from f

View 1 Replies

Calculate Time Taken To Execute A Function?

Apr 26, 2010

I want to calculate the time taken to execute a function.[code]...

View 6 Replies

Function To Change Number To Time?

Apr 13, 2012

Currently just started working with VS2008 I have a SQL script that is returning a number looking time in one of my columns (50625) which is 5:06:25 What I would like some help with is creating a function that would take this value and change it to a real time at some point I will need to do further calculation on these times so I need to be able to add or subtract these results.[code]...

View 3 Replies

How To Use Timer Function Just As Time Delay

May 29, 2010

What line of code would I need to use the timer function just as a delay, so like as lines are being executed, once it gets to this timer it waits for say 1500 milliseconds before execution is continued.

View 4 Replies

Make My Function Pause For A Certain Time?

Mar 8, 2012

I am facing an issue. Actually what i am doing is that i am tryin to store certain values in a database. A function is such that it calculates 5 values and stores them in a database. While storing them in the database it displays them in a textbox on the form. Now i want to display them one by one which it does. But it does it so fast that i can only see the last value that it enters in the database inside the textboxes.[code]...

View 9 Replies

Perform A Function At A Specific Time In .NET?

Mar 25, 2010

I am writing a small app to automatically connect my PC to the internet at a certain time and I am using rasdial.exe for it...

Private Sub SetIt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SetIt.Click
Dim windir As String = Environment.GetEnvironmentVariable("WINDIR")
Shell(windir & "system32
asdial.exe", AppWinStyle.NormalNoFocus)
End Sub

My question is how to make the shell function run at a specified time or after a certain interval?Also how to wake up my PC from hibernation using vb and winresume.exe

View 1 Replies

Read Hex At The Same Time Loop The Function?

Oct 29, 2011

I'm a newbie in VB.. I'm editing a file that sets the click-able area of a button in a game.

[Code]....

View 6 Replies

Set Time Interval To Every 5 Minute Which It Will Do Function

Jun 11, 2011

[code] As my program above, i set the time interval to every 5 minute which it will do the function. However, after 5 minites it does not affect any thing in my program, is that my coding wrong? or I had miss something?

View 7 Replies

VS 2010 Limiting Function Time

Nov 29, 2011

Currently I have calculated that one of my functions executes 62 times per second (on average). How can I limit this to say exactly 50 times a second (every time)?

View 3 Replies

Execute A Function In Every Time I Choose Using Program?

Mar 3, 2012

Is there any command in Visual basic that can execute a function every time I choose just like setInterval in Javascript

View 1 Replies

Invoke A Function Unknown At Design Time?

Sep 17, 2010

is it possible to invoke a function which name I know at runtime only.

View 2 Replies

Make A Car Run Same Time Beginning And Any One Can Win Using The Random Function?

Nov 17, 2010

[Code]...

Inherits System.Windows.Forms.Form

[Code]...

View 2 Replies







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