Multi-threading related questions including technique, structure, and safety issues.
0
votes
0answers
30 views
Object pooling in managed environments
My application tries to process chunks of data, each sized at tens of megabytes, but not fixed size.
I use a producer for data fetching, and consumer for data processing,
Since I do not control the ...
2
votes
2answers
132 views
Send stdout or stderr to a new thread
For performance issue I want the logging send to a new thread.
While the main program can work, the new thread can write the error or other messages to a file without effect to the main program. How ...
0
votes
1answer
118 views
Android game loop in separate thread
I am about to port a game that was initially written for iOs and I am having some doubts how certain things should be done.
I have been looking many of the examples of the game loops for android, and ...
13
votes
1answer
480 views
Best practise is not to poll…but isn't polling happening internally anyway when a thread calls wait()?
Say we have some thread that wants to check when another thread is finished its task. I have read that we should call a wait() type function that will make this thread wait until it receives a ...
-2
votes
1answer
102 views
How do I scale a server application? [closed]
I have to work on a UDP Client Server application, where for now there are 40 clients.
In the present scenario the server should be able to communicate (send and receive data) with all the clients if ...
0
votes
1answer
135 views
Multi-threaded server
I have written a server/client program in which I am using 2 threads :
One to recieve data continously and
Other to send data as the user writes it on screen
Problem:
I have created the threads ...
-2
votes
2answers
87 views
Calling blocking functions and execute code when result is ready, but without callbacks
I am designing an application that has some scripting capabilities: the host application may call the scripts to perform some operations when some events occur. To keep it easy and newbie-friendly, ...
7
votes
2answers
176 views
How to maintain synchronised state across threads - is this a good use for a Singleton?
I hear a lot about "Singletons are always bad" around the place. I don't hate on them to that degree but I try not to use them if I have a better alternative.
In this case I have a system that ...
0
votes
0answers
168 views
Method for detecting deadlocks [closed]
I believe I've invented a procedure for detecting multithreading deadlocks before they happen.
The procedure is an augmented "acquire" function that returns if blocking would deadlock. We would ...
2
votes
3answers
175 views
Is there a way to calculate whether to spawn a new thread or use current thread
I am building an interpret DSL in which parallelism is part of the language - the user simply states that a calculation can be done in parallel and the interpreter may decide whether to make the ...
1
vote
0answers
87 views
Thread safety IDE warnings
I wonder, would it not be possible for an IDE to detect any shared mutable objects that are used in multiple threads?
You could flag types as either [ThreadSafe] or [Immutable] using attributes in ...
4
votes
2answers
164 views
Allow threads (in c) to print messages without interfering with user input
I'm a writing a small webserver for personal use in c (not c++). I want to allow user input in the console like "shutdown server" or "restart server".
In order to allow this kind of input the server ...
6
votes
3answers
594 views
BackgroundWorker vs. Async/Await
I am new to C# development and wish to create a more responsive UI. In my preliminary research, I have seen two methods for achieving this:
Multi-threading in conjunction with the BackgroundWorker ...
2
votes
2answers
126 views
Should I split out synchronization from my class and what's it called?
When thinking about testability and modular code, I recently thought about whether I should split out the synchronization part of a class from the actual behavior part.
By example:
The app "needs" ...
2
votes
1answer
220 views
Spurious wakeups explanation sounds like a bug that just isn't worth fixing, is that right?
According to the Wikipedia article on Spurious Wakeups
"a thread might be awoken from its waiting state even though no thread signaled the condition variable".
While I've know about this ...