Hi everyone, I am an intermediate c++ programmer and done some work using ACE, now I want to learn one of those Libraries thoroughly to progress in to my career. That why I need your kind help to make a decision, that what should I learn first. And also please consider my destinations are to be an expert network programmer and Protocol d...
Dear all,
we have two threads accessing one list via a synchronized method. Can we
a) rely on the run time to make sure that each of them will receive access to the method based on the order they tried to or
b) does the VM follow any other rules
c) is there a better way to serialize the requests?
Many thanks!
...
Hello, it's my first message here and I'm glad to join this community.
It looks like that everything is now going towards multi-thread development. Big fishes say that it won't take longer to reach hundreds of cores.
I've recently read about actor based development and how wonderful message passing is to handle concurrent programming. ...
I would like to write a program to receive some data using tcpClient from a specified ip and port number. First time I did it using while(true). Friend of mine told me to use thread instead of while loop. So I did as he said.
public static void receiveThread()
{
TcpClient tcpClient = new TcpClient();
try
{
tcpClient....
As far as I know, .NET uses Windows processes.
What extra state information & functionality does it add to information contained in Windows thread/process descriptors?
And what is different in Linux (on Mono)?
...
Let's say I have a simple tcp server generating an array inside a thread, serializes it and sends it to a client over tcp connection and when it reaches the client, the client deserializes it and performs something...ie. continuous calculation. Well it's a pretty straight forward process but I would like to know if the process has any pe...
Preface: This has become a quite a long post. While I'm not new to programming, I have close to zero practice around threading and could need some help here...
This is probably a common problem that could be described in shorted words, but I'm a bit overwhelmed with it.
Some background first...
I'm writing code for the iPhone where I ...
Hi,
I have some operations which are based on TThreads. Now I need to create the thread containing the list of jobs to be done, then firing each one as soon as the previous finishes... How should I write it? I can't allow the threads to be ran simultaneously as there might be over 10 000 operations to be done.
It is quite hard to find ...
I have 2 nested threads.
First thread starts multiple instances of second thread. Each second thread has to sleep for some time (5 seconds).
I want to start the first thread and return a message to user immediately, but it seems my first thread waits until all the children of second thread to finish.
How can I achieve this? Any help?
...
I have a rather simple multi-threaded VCL gui application written with Delphi 2007. I do some processing in multiple child threads (up to 16 concurrent) that need to update a grid control on my main form (simply posting strings to a grid). None of the child threads ever talk to each-other.
My initial design involved calling TThread's "S...
Is it possible for threads to share data (Global Variables) in same process.
...
This is a modification of code from the Java tutorial on Concurrency
package threads;
public class SimpleThreads {
static void threadMessage(String msg) {
String threadName = Thread.currentThread().getName();
System.out.format("%s: %s%n", threadName,msg);
}
private static class MessageLoop implements Runnable{
@Override
pub...
Hopefully the code itself explains the issue here:
class Server {
public void main() {
// ...
ServerSocket serverSocket = new ServerSocket(PORT);
while (true) {
Socket socket = serverSocket.accept();
Thread thread = new Thread(new Session(socket));
thread.start();
}
// ..
}
public...
I have code similar to following:
public class Cache{
private final Object lock = new Object();
private HashMap<Integer, TreeMap<Long, Integer>> cache =
new HashMap<Integer, TreeMap<Long, Integer>>();
private AtomicLong FREESPACE = new AtomicLong(102400);
private void putInCache(TreeMap<Long, Integer> tempMap, int fileNr){
i...
When I try to add 3D-content to a Viewport3D, asynchronously, this results in "This API was accessed with arguments from the wrong context." in a TargetInvocationException.
The 3D-content is generated from the data of a 3D-scanning device. The communication&calculations needed for that are done in a separate thread. First, I tried to a...
Clearly if performance is critical it makes sense to prototype and profile. But all the same, wisdom and advice can be sought on StackOverflow :)
For the handling of highly parallel tasks where inter-task communication is infrequent or suits message-passing, is there a performance disadvantage to using processes (fork() etc) or threads...
I've extended FutureTask from java.util.concurrent to provide callbacks to track the execution of tasks submitted to an ExecutorService.
public class StatusTask<V> extends FutureTask<V> {
private final ITaskStatusHandler<V> statusHandler;
public StatusTask(Callable<V> callable, ITaskStatusHandler<V> statusHandler){
sup...
Is there an algorithm that checks whether creating a new thread pays off performance wise?
I'll set a maximum of threads that can be created anyway but if I add just one task it wouldn't be an advantage to start a new thread for that.
The programming language I use is python.
Edit 1#
Can this question even be answered or is it to gener...
Hi community!
I have a multithreaded Java code in which:
several threads read stateful objects from the synchronized shared storage (i.e. as a result of this, some threads may reference the same objects);
each thread then invokes a method process() and passes its object there;
process() processes objects in some way, which may result ...
Normally will we interrupt a thread which is in "WaitSleepJoin" state or "Running" state?
...