The thread tag has no wiki summary.
1
vote
5answers
516 views
Why does the instruction “do” require a “while”?
Since this statement is so common:
while (true) (Java)
or
while (1) (C)
or sometimes
for (;;)
Why is there not a single instruction for this? I could think that an instruction that could do it ...
4
votes
2answers
278 views
Managing threads in Java with a good pattern
This morning I began writing a minimal chat using Java socket and threads but it took some minutes for me to experience a lot of problems in the MVC management.
Currently I have 3 classes:
Main, ...
-2
votes
2answers
142 views
When will be safe to choose Multi-thread design without dead lock? [closed]
Sometime we really need to choose a multi-threaded design, because single-threading will block the UI or block another thread.
But sometimes using multiple threads is just one of the choices, for ...
0
votes
2answers
143 views
Queues and threading
I am developing a new project where I will be constantly checking a webpage for data and adding this data to a queue for processing. This data will then be removed from the queue and added to a list ...
25
votes
3answers
3k views
Is GCC dying without threads support on Windows?
I need some opinion. GCC was always a very good compiler, but recently it is losing "appeal".
I have just found that on Windows GCC does not have std::thread support, forcing Windows users to use ...
13
votes
1answer
597 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 ...
4
votes
2answers
247 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 ...
0
votes
1answer
179 views
What makes a series of machine instructions an actual process/thread in memory?
Every instruction comes from main memory/RAM.
In a bootloader, at least on Intel and IBM PC firmware and designations, you
have BIOS jump to a memory address to begin fetching instructions for ...
0
votes
2answers
154 views
How bad would it be to obtain a lock on every object?
Imagine a hypothetical programming environment that is largely like Java or .NET, i.e. object-oriented, garbage-collected, etc., but with one small change:
Every time you call a method on an object, ...
-1
votes
2answers
550 views
Should I use simple socket programming to communicate between 2 threads? [closed]
Is it a good idea to communicate between 2 threads using sockets in Java?
What I am trying to achieve is Inter-process communication using socket programming/RPC mechanism.
1
vote
3answers
202 views
Inter-process and inter-thread data sharing [closed]
I know that operating systems facilitate inter-process and inter-thread data sharing. I want to know about the mechanisms used to facilitate such sharing. I read about "pipes". What are the other ...
7
votes
3answers
1k views
What is a thread pool?
In an interview question a guy was asked to "implement a threadpool"... I've been reading on wikipedia for "threadpool" but I still can't figure out what should a guy do to solve this question ...
2
votes
2answers
213 views
What is the difference of delegator and dispatcher?
What is the difference of delegator and dispatcher?
I am not quite sure of either concept.
-1
votes
1answer
624 views
What happens at control invoke function?
A question about form controls invoke function.
Control1 is created on thread1.
If you want to update something in Control1 from thread2
you must do something like:
delegate void ...
1
vote
3answers
360 views
Algorithm for appointment reminders
My program allows users to store appointments in a calendar. What has been requested of me is the ability for SMS reminders to be sent to people to remind them of their appointment. The SMS would ...
0
votes
2answers
465 views
Google Maps-based desktop application [closed]
I want to build a desktop application which has google maps embedded to it. This app should have a thread to read coordinate data online a usb microphone to use. This application will move the google ...
3
votes
1answer
271 views
Is a readonly field in VB.NET thread safe?
Is a readonly field in VB.NET thread safe? For example, see the code below:
Class Customer
ReadOnly Name As String
ReadOnly ZIP As Integer = 98112
Sub New(ByVal Name As String)
Me.Name = ...
7
votes
5answers
1k views
Do threads use virtual memory or real memory?
I was trying to optimize my Linux server to handle 10,000 threads per process while it does just 382 right now. As per this article the following formula is used to find out total possible threads:
...
10
votes
1answer
220 views
Drawing thread interaction
I'd like to draw (pen and pencils) threads interaction in a UML(-like) notation. I don't insist on UML, anything that is obvious to the reader should do.
I started with sequence diagrams, but I don't ...