Hi All,
This is a somewhat generic question. Suppose that I am creating a simple application in Java or VC++ which creates two threads and I run the application in a multicore system. Without any specific directive for which core to run, will the application itself will distribute the threads across various cores?
Thanks.
...
I've written a simple application in Java where there are two nodes, each with a ServerSocket open to a port listening for incoming connections. The nodes run two threads each, sending 1000 messages to the other node through a persistent TCP socket created when sending the first message. However, the nodes do not receive all 1000 message...
We have a method which, due to threading in the client application requires the usage of SynchronizationContext.
There is a bit of code which one of my colleagues has written which doesnt "feel" right to me, and a performance profiler is telling me that quit a lot of processing is being used in this bit of code.
void transportHelper_Su...
Straightforward C#/Java code is extremely difficult to parallelize, multi-thread, etc. As a result, straightforward C#/Java code will use less and less of the total processing power on a box (because everything is now going to be multi-core).
Solving this problem in C# and Java is not simple. Mutability and side effects are key to get...
I'm coming largely from a c++ background, but I think this question applies to threading in any language. Here's the scenario:
We have two threads (ThreadA and ThreadB), and a value x in shared memory
Assume that access to x is appropriately controlled by a mutex (or other suitable synchronization control)
If the threads happen to run ...
While debugging an issue with our system, I have discovered a thread contention that is causing a bottleneck. I need to explain the phenomenon to other people involved in handling this issue. Some of them are not from development team (yet, they are reasonably technical). So what type of diagrams can be used to depict threading issues...
Hello everyone,
I am new to programming in general so please keep that in mind when you answer my question.
I have a program that takes a large 3D array (1 billion elements) and sums up elements along the various axis to produce a 2D array of a projection of each side of the data. The problem here is that it is very ram intensive as th...
Using C#, I want to generate 1,000,000 files from DB, each record in separate file.
What is the best way to generate this files in minimum time?
Here is my code without threading :
AppDomain.CurrentDomain.ProcessExit += new EventHandler(CurrentDomain_ProcessExit); // to calculate the execution time in case of using threading
SqlCom...
Over the past few weeks I have been building a prototype application using a Flex front end connected to a J2EE backend using blazeDS.
The prototype is an experiment to learn flex and see what its suitability is for a complex trading application requiring a large number of dynamic updates (i.e > 20 a second) via a pub sub type model.
D...
I am on Windows (Windows 7, XP and Vista). If I create a multi-threaded program, will the threads be executed on all available cores? Is it automatic? Is it guaranteed?
For example, if I have four threads and four processors, will the threads be executed one on each processor/core?
...
I'm modifying a windows form to allow data to be loaded in the background while the UI remains responsive. The data takes noticeable time to both retrieve and bind. Ideally, I would do both in the background, but there is some ambiguity about what kind of UI updates I should be doing in the background (as in outside the main thread). ...
Is using the 'synchronized' keyword on methods in a Java DAO going to cause issues when used by a web application?
I ask because I have a multi-threaded stand alone application that needs the methods to by synchronized to avoid resource conflict, as seen here.
java.util.concurrent.ExecutionException: javax.persistence.PersistenceExcept...
Our WCF services occaisionally spawn a worker thread to handle something that the client doesn't care about. The worker threads do not report any status back to the client. In fact, the service has probably already returned results to the client by the time the thread finishes.
One of these background threads recently caused an except...
I've got a java application on a windows machine which pins the CPU from time to time. Would like to run a utility to get an idea of how many threads etc that application is creating. Is there such a utility?
...
Hello,
I need to create two (or more) WPF windows from the same process. But the windows must be handled by separate threads because they should not be able to block each other. How do I do this?
In WinForms this is achieved by:
Start a new thread
Create a form from the new thread
Call Application.Run with the form as parameter
But...
Hi there, I'm writing a Java application that will instantiate objects of a class to represent clients that have connected and registered with an external system on the other side of my application.
Each client object has two nested classes within it, representing front-end and back-end. the front-end class will continuously receive da...
Any suggestions on how I can cleanup the following code pattern that repeats multiple times in my app.
new Thread(new Runnable() {
public void run() {
// Do some work here
SwingUtilities.invokeLater(new Runnable() {
public void run() {
// Update the Swing Interface to reflect the change
}
});
}
}).st...
Hello,
I use the following function to show controls on my form:
class procedure TFormMain.FadeControls(ctrl:Array of TwinControl);
var element:TwinControl;
begin
for element in ctrl do
begin
PrepareForAnimation(element);
element.Visible := true;
AnimShowControl(element,250);
end;
end;
However,it slows down with 250...
I am building a CD ripper application in C++ and Qt. I would like to parallelize the application such that multiple tracks can be encoded concurrently. Therefore, I have structured the application in such a way that encoding a track is a "Task", and I'm working on a mechanism to run some number of these Tasks concurrently. I could, of ...
Hello everyone. I am using API that originally was written with native code and wrapped with .net interops. The API is work asynchronic way when each operation raises event when it finished.
All my logic is synchronic so I want to synchronizing the operations. I doing it with EventWaitHandle. here the code
Stock stock;
private System.T...