I am trying to simulate X number of concurrent requests for a WCF Service and measure the response time for each request. I want to have all the requests hit the Service at more or less the same time.
As the first step I spawned X number of Threads, using the Thread class, and have invoked the Start method. To synchronize all the reque...
Let's say that if I read from www.example.com/number, I get a random number. In my iPhone app, I want to be able to continuously read from that address and display the new number on the screen after each request is finished. Let's also assume that I want this process to start as soon as the view loads. Lastly, as a side-note, I'm using A...
I'm new to multithreading in Perl and looking for something similar to Java's thread pools.
Any recommendations?
...
Hello,
my target is it to collect data from clients which send data to an UDP server, concatenate the data in a string (just for testing now) and send the whole concatenated string back to the client. The communication between UDPClient and UDPServer works perfect. I can send data and receive it. But I wonder why I can't concatenate the...
I'm pretty new to web programming and I'm currently developing a web back end for a mobile application. Currently I have the users log in using servlet interactions and once they have full access to the application I need to open a Socket Connection so that I can provide server pushes. Now the problem I'm running into is how people handl...
I have an underlying asynchronous out-of-order query/response system that I want to make synchronous. Queries and responses can be mapped by marking the queries with unique IDs that in turn will accompany the corresponding responses.
My attempt at making it synchronous uses two ConcurrentHashMaps: one that maps from IDs to results, and ...
I'm trying to write a Java serial device driver and want to use the (new to me) java.util.concurrent package. I have one method which sends a packet then waits for an ACK. I plan to have char. reception run in a different thread. If the receive thread gets an ACK it should notify the thread with the send packet function. The receive ...
The only AsyncTask that I have that is working properly is one that handles a progressdialog for a search. None of my other AsyncTasks are getting to onPostExecute() even though the doInBackground() is completing! I am pulling my hair out because it used to work in earlier commits and doing a compare, I see no difference! A lot of the As...
I have a class that exposes two methods:
- GetObject
Gets a single object, or returns null if there are none.
- WaitForObject
Gets a single object, or waits until their is one.
An example implementation:
class MyClass
{
MyStack stack;
public object GetObject()
{
return stack.Pop()...
I'm working on an application which interacts with hundreds of devices across a network. The type of work being committed requires a lot of the concurrent threads (mostly because each of them requires network interaction and does so separately, but for other reasons as well). At the moment, we're in the area of requiring about 20-30 thre...
For example, I've got a business object Person:
class Person : INotifyPropertyChanged
{
string Name { get; set; }
DateTime DateOfBirth { get; set; }
}
// ^ abbreviated for better legibility; implementation would be trivial
And I've got some Winforms UI controls data-bound to an object of this class:
Person somePerson = ...;
n...
Write a class named RaceHorse that extends Thread. Each RaceHorse has a name and run() method that displays the name 5000 times. Write a Java application that instantiates 2 RaceHorse objects. The last RaceHorse to finish is the loser.
This is the question.
I have written the code for the two classes two run the thread
Here are the code...
I'm working on my first game, and it works fine, but clearly needs some optimizing. Initially, I had everything running on one thread (I used the LunarLander API to get started on gaming). Since then, I've added 2 new threads to the game. It still works just fine, but I see no improvement. I must be doing something wrong..
This is the b...
Python 3.2 ALPHA is out.
From the Change Log, it appears the GIL has been entirely rewritten.
A few questions:
Is having a GIL good or bad? (and
why).
Is the new GIL better? If so, how?
UPDATE:
I'm fairly new to Python. So all of this is new to my but I do at least understand that the existence of a GIL with CPython is a huge deal...
A quote from MSDN
Assigning an instance of this type is not thread safe on all hardware platforms because the binary representation of that instance might be too large to assign in a single atomic operation.
Does it mean is that Thead-safe on 64bit processors like Itianium or x86-64 as well?
For instance:
long data = GetData();
/...
Hello,
I'm developing C# .NET windows Forms application. In which I've a main window and few other window form classes (which are used as dialogs). I've a computationally intensive task(takes 3-4min). When user selects this task from the menu, a new dialog (window) pops up and takes parameters required from the user and it has a progres...
I want to implement the following logic:
private static AutoResetEvent _autoResetEvent = new AutoResetEvent(false);
static void Main(string[] args)
{
var someObjectInstance = new SomeObject();
someObjectInstance.SomeEvent += SomeEventHandler;
_autoResetEvent.WaitOne();
//...
}
static void SomeEventHandler...
We have a C# service that has started failing in very odd ways around thread handles. Specifically calls to EventWaitHandle.Reset, ReaderWriterLock calls, and other similar threading calls are randomly blowing up with Invalid Handle errors deep in the stack. These are calls that are definately supposed to work. Could this be a sign of me...
1>Linking...
1>main.cu.obj : error LNK2001: unresolved external symbol cutWaitForThreads
1>main.cu.obj : error LNK2001: unresolved external symbol cutStartThread
I get those errors when trying to compile my project. I have included the cutil64 in linker dependencies, but I can see that's not it. I can't seem to figure out what's wrong w...
I have an object which is running on an STA thread.
Sub MyAsyncTask()
Do
MyWorker = New JobWorker()
MyWorker.Work()
Loop
End Sub
Protected InnerThread As New Thread(AddressOf Me.MyAsyncTask)
Public Sub Start()
Started = Now
InnerThread.SetApartmentState(ApartmentState.STA)
Inn...