0
votes
0answers
23 views

NullReferenceException when creating a thread

I was looking at this thread on creating a simple thread pool. There, I came across @MilanGardian's response for .NET 3.5 which was elegant and served my purpose: using System; using ...
1
vote
3answers
60 views

C#: Make Task run simultaneously

I am trying to run Several Tasks continously, non-stop. Here is my code: int maxThread = 100; Task[] tasks = new Task[maxThreads]; while(true) { for(int i = 0;i<maxThreads;i++) { ...
2
votes
2answers
39 views

Collection was modified; enumeration operation may not execute. Lock is being used everywhere how possible?

This is a small program that only i am writing and using. Now i am going to write code of all areas where i use the hashset that caused this problem I don't understand how this is possible. This ...
0
votes
1answer
73 views

Using threads to calculate values in the background

I am working on a program that queries information from a remote computer. WMI, registry, etc. I have most of that all finished up, but without threading it runs pretty slow. (I assume it is waiting ...
0
votes
1answer
17 views

how to use thread to capture screen after scrolling in UI

I have a windows form which hold a web browser control, that web browser will change it's position automatically in fixed positions So first I set the navigate to position X then I will take a ...
1
vote
2answers
49 views

Why does this multithreaded multiconnection TCP server only accept one connection?

story behind all of this I'm trying to write an open source RPG inventory server, usable for more than 1 RPG at once, and will make a game for it later on. My first version doesn't support a lot of ...
1
vote
0answers
21 views

Launching copy/paste event not working

[CODE CONTEXT] Hi everyone, I'm working on an application which launch copy or paste event by sending keyboard event to press key C and Ctrl. I'm actually having this method to send Kb event : ...
0
votes
3answers
61 views

What's the “right” way to delay a method running in C# for a set amount of time after an event while still letting the original thread run?

I have a project in C# (using WPF) which involves a user placing 2d markers on a canvas to generate 3d geometry. When the 2d arrangement changes there's a fair amount of math that happens, and then a ...
2
votes
1answer
101 views

Could pinging several IPs make my network busy?

I developed an application that pings 60 IPs, but if I run it at home most of replies are 'request timed out', whereas if I do the same thing at work, 3 out of 4 replies are ok. I thought it was due ...
2
votes
2answers
65 views

Atomic wait-then-take operation on number

I have the following class: public class AtomicLong { private long initial; private long value; public AtomicLong(long value = 0) { this.initial = value; this.value = ...
13
votes
4answers
10k views

Creating threads - Task.Factory.StartNew vs new Thread()

I am just learning about the new Threading and Parallel libraries in .Net 4 In the past I would create a new Thread like so (as an example): DataInThread = new Thread(new ...
1
vote
2answers
43 views

Threading Mechanism for the following Scenario

I am new to multithreading programming. Is it possible to have the following situation? If one thread is writing on a object, no other threads can read or write on it. If on one is writing on it, ...
0
votes
1answer
20 views

Thread doesn't wake up after join

I've got a GUI interface which has a start and a cancel button. After starting, the main thread which is the GUI thread, is creating a second thread which will do the actual work. When pressing the ...
-2
votes
1answer
71 views

Thread inside a System.Timers.Timer method

I have the following scenarios using System.Timers.Timer. Create a Timer object and assign the method _JobListener.Enabled = false; _JobListener.Elapsed += (this.JobListener_Elapsed); Within ...
7
votes
8answers
3k views

How to let Timer skip tick if the previous thread is still busy

I created a windows service, that is supposed to check a certain table in the db for new rows every 60 seconds. For every new row that was added, I need to do some heavy processing on the server that ...

1 2 3 4 5 583
15 30 50 per page