Multi-threading related questions including technique, structure, and safety issues.

learn more… | top users | synonyms (3)

1
vote
3answers
566 views

3 threads printing numbers of different range

This question was asked in an Electronic Arts interview: There are 3 threads. The first thread prints the numbers 1 to 10. The second thread prints the numbers 11 to 20. The third thread prints the ...
5
votes
1answer
2k views

Parallel programming library? (+ some features)

Note: this is a reposting as the question has been considered non-suitable for the Stack Overflow forum and should have been posted here. The original topic is there. I'd like to talk of ...
1
vote
2answers
823 views

Design choices when doing multithreading in C++

OK, so, background: I have a little "server" app/module that is written in C++. This is kindof a tunnel application that provides a standardized API via TCP/IP[a] and on the other hand talks to the ...
65
votes
14answers
13k views

What can multiple threads do that a single thread cannot?

While threads can speed up execution of code, are they actually needed? Can every piece of code be done using a single thread or is there something that exists that can only be accomplished by using ...
4
votes
4answers
339 views

What's the opposite colour to “green” for a native thread?

Simulated threads are known as "green threads" in programming-language-wonk speak. They are compared to "native threads" as provided by the operating system, but is there an analogous colour for ...
7
votes
2answers
212 views

Are Concurrency Abstractions Emulating UNIX Processes?

OK, I was pondering this today, and I've come to ask for completely subjective and bias opinions on it. Paradoxically, despite this, I don't think it's flame-war fodder either. I think there is room ...
0
votes
3answers
937 views

Design pattern for a multi-threaded URL fetcher in java

I'm looking for hints and suggestions on a design for a multi-threaded URL fetcher in java. Specific requirements are: To fetch each one of around 1,000 URLs periodically The interval between each ...
11
votes
7answers
967 views

What constitutes proper use of threads in programming?

I am tired of hearing people recommend that you should use only one thread per processor, while many programs use up to 100 per process! take for example some common programs vb.net ide uses about 25 ...
3
votes
3answers
261 views

How to you solve the problem of implicit locking and parallel execution?

Where the code is: function A() { lock() doSomething() unlock() } We can call A safely from multiple threads, but it never be executed in parallel . For parallel execution, we have to ...
7
votes
3answers
12k views

Multi-threading in C# .NET Windows Service

I am writing a Windows Service (using C# .NET 3.5 VS2008) and my requirement is: When the Windows Service start - it performs record check operation (in Database) @ every 30 second interval (I have ...
12
votes
8answers
707 views

Can anyone suggest a project for me write to help me understand threading

I am currently a C# developer with a pretty shaky understanding of threading. Both of these links have been suggested in other posts: http://www.yoda.arachsys.com/csharp/threads/ ...
10
votes
8answers
992 views

What lessons did you learn from a project which nearly/actually failed due to bad multithreading? [closed]

What lessons did you learn from a project which nearly/actually failed due to bad multithreading? Sometimes, the framework imposes a certain threading model that makes things an order of magnitude ...
1
vote
2answers
198 views

Descriptive Locking and Concurrency

I'm thinking about how one would go about designing a descriptive concurrency model for an OOP language that helps simplify concurrency scenarios for programmers (no easy task, concurrency is hard). ...
0
votes
5answers
646 views

Examples of concurrent iterating scenarios needed

I'm trying to wrap my head around different concurrency solutions to several threads iterating over the same collection but I'm having difficulty coming up with good realistic (but preferably easy to ...
13
votes
6answers
1k views

Why don't xUnit frameworks allow tests to run in parallel?

Do you know of any xUnit framework that allows to run tests in parallel, to make use of multiple cores in today's machine? If none (or so few) of them does it, maybe there is a reason... Is it that ...
1
vote
6answers
476 views

Structuring multi-threaded programs

Are there any canonical sources for learning how to structure multi-threaded programs? Even with all the concurrency utility classes that Java provides I'm having a hard time properly structuring ...
12
votes
4answers
2k views

Is It “Wrong”/Bad Design To Put A Thread/Background Worker In A Class?

I have a class that will read from Excel (C# and .Net 4) and in that class I have a background worker that will load the data from Excel while the UI can remain responsive. My question is as follows: ...
4
votes
2answers
603 views

What are the so-called “levels” of understanding multithreading?

I seem to remember reading somewhere some list of 4 "levels" of understanding multithreading. This may have been in a formal publication, or it may have been in an extremely informal context (even ...
12
votes
6answers
2k views

What do you look for when debugging deadlocks?

Recently I've been working on projects that heavily use threading. I think that I'm OK at designing them; use stateless design as much as possible, lock access to all resources that more than one ...
0
votes
1answer
47 views

Where to put profile test?

I have an application with multiple threads that may be run on different hardware. To assist with tuning on different hardware I would like to create a "profiler" that can automatically run a fixed ...
0
votes
6answers
316 views

What is the point where multitreaded programming becomes slower than the problem?

I currently try to design an engine at the core level. However, I cannot decide if input thread should be mixed with a rendering thread or any other thread. Would making it an extra thread with all ...
1
vote
2answers
628 views

Multithreaded UI desktop application issues

I am involved into development a rich UI project: desktop windows application. Application uses asynchronous invocations and in its turn it should be ready to process external messages (events). The ...
4
votes
6answers
440 views

What threading pratice is good 90% of the time?

Since my SO thread was closed i guess i can ask it here. What practice or practices are good 90% of the time when working with threading with multiple cores? Personally all i have done was share ...
5
votes
1answer
215 views

Need to re-build an application - how?

For our main system, we have a small monitor application that sits outside our network and periodically tries to log in to verify the system still works. We have a problem with the monitor though in ...
20
votes
6answers
5k views

How would you practice concurrency and multi-threading?

I've been reading about concurrency, multi-threading, and how "the free lunch is over". But I've not yet had the possibility to use MT in my job. I'm thus looking for suggestions about what I ...
10
votes
7answers
811 views

What false ideas are there that puts people off using threads? [closed]

Implementing threading in a program is hard, yes, however why is it that some people will not implement them even when there is an obvious need for it. An example: Program has to load a dataset from ...
45
votes
19answers
6k views

Servicing background tasks on a large site

We're dealing with an interesting problem on StackOverflow. We've got a whole bunch of little "needs to be done soon-ish" tasks. An example is updating "Related Questions" lists. What we've done in ...
20
votes
7answers
3k views

How do I unit test multi-threaded code?

Are there ways to unit test your multi-threaded code for race conditions and deadlocks? To see if they are performing the way they should be...