Questions for multithreading


4951

Using Thread with paint java

I'm developing a checkers game in Java, and I stumbled on a problem.
423

How to set a relationship from one NSManageObject to another in a different NSManagedObjectContext

Because my app is multi-threaded I use two NSManagedObjectContexts. The main context, that runs in the main thread and another context that only runs in a separate thread.
3019

endBackgroundTask without the background identifier

I'm using a library which is closed source that is starting a background task and I don't have the background task identifier...
4283

Android: AsyncTask how to use wait/notify

Is it possible to call wait & notify inside an AsyncTask? So far, I tried to use them but all it does to block the AsyncTask forever. How can I overcome this? My usage is: I have a camera frame
9826

setting up matlab multicore computing

I'm trying to use something like this in matlab
459

mutual exclusion using Hashtable of java

hi mate i have a global Hashtable in my class, and two thread A and B that work with her.
6112

How I can use threads to generate terrain based on camera position without bursts of lag?

Here's the deal. My game generates chunks of randomly generated terrain based on the position of the camera (2D isometric). When moving from chunk to chunk, there is always a tiny burst of lag which
8176

Is there a way to set thread priority in Glib v2.32+?

Glib 2.30 API allows setting thread priority via GThreadPriority enum. However, that API is deprecated as of 2.32 and I can't find any info on setting thread priorities using the new API. I've Ctrl...
2385

Show progress bar when Entity Framework transfer data

I have a project that uses data from Entity Framework and present them in WPF. I want show threaded progress bar when Entity Framework load/save data on presentation layer.
9367

NSThread issue with an iPhone Application

I have a rather complex application at https://github.com/BigBadOwl/iStreamer-Download-Manager which uses Rtmpdump and Ffmpeg libraries to download and convert Flash streams. I would like the thread
6438

Monitoring C# Threads - Which does what/when

As everybody, I am used to debugging my code in VS in step-by-step mode. Well, now that I have an application with many Background Workers everywhere, I am not in Kansas anymore.
8790

How to Terminate loop/thread

Here is part of my program. Loop in findDuplicates starts in background thread after button was pressed. Is there any way to stop/kill thread/loop by pressing another button?
8401

Threading and Incrementing

So I think this might be a fundamental flaw in my approach to threading and incrementing a global counter, but here is my problem. I have a collection of file names from a DB that I iterate through...
9289
3994

Gracefully ending a thread that's waiting on a blocking queue

I'm having an issue with a multi-threaded server I'm building as an academic exercise, more specifically with getting a connection to close down gracefully.
1935

How to access a given Java thread

Basically, I want to be able to run multiple threads - these threads will use sleep commands for a given period. I want to be able to manipulate the duration of these sleep threads based on user in...
9620

Why main thread waits for another thread to finish before proceed?

The problem that I am facing in a complex Java application boils down to following: the main thread does not proceeds until the sub-thread is not finished, although I thought that it should. The code
2807

java.util.Timer or a While loop in a SwingWorker thread?

In another question I posted recently I was suggested to use a java.util.Timer in the SwingWorker instead of a while loop. The tasks in the SwingWorker are supposed to run every 10 seconds.
8241

Show progress text while logging user in - Android App

I'm working on an Android app and am having trouble updating the GUI. Basically what I want to achieve is when my user clicks the Sign In button, call the setVisibility method on the groupLogInPro...
8883

Setting Local Notifications on a new thread?

I need to know if it is possible to create a new thread to handle setting local notifications.
7789

How to allocate from heap with the correct memory alignment for InterlockedIncrement function?

This code seems to work, but have I used the InterlockedIncrement function correctly? The correct memory alignment of m_count is of my primary concern. Assume we're on a x86-64 system and compile a
570

Multi-threaded Mergesort problems

I'm trying to write a multi-threaded mergesort, and I'm having what to me are very confusing issues. I'm not fully aware of the rules of how threads share/use variables...
1951

How to use the threads from a thread pool for every httprequest in java?

I need to create a thread pool of a fixed size and use the thread for every http request. Can anyone specify how to do this?
9433

How to write a simple thread-safe class using a volatile variable?

I want to write a simple thread-safe class that could be used to set or get an Integer value.
8055

Keeping webservice alive if a spawned thread is still working

I have a webservice that will be called by a nightly job process documents, each document will be queued and executed on it's own background processor. This process can take a couple hours or a few
1280

How to send a subprocess to the background & without using shell=True

I'm trying to write a part of a Python script what changes the root MySQL password under Linux for a small web-admin interface. I've followed the official MySQL documentation on changing the root
3100

using dispatch_sync as a mutex lock

Here is what I need to do.
4047

Using a semaphore instead of while loop. Is this good or bad?

I have a process that runs in it's own thread and can be started/stopped without blocking. This will eventually go into a Windows service, but I am setting this up in a console app for now until i...
7616

Ruby - Why Thread doesn't respect method put?

The following code throw messages without putting them with line break.
8622

How to implement a singleton .NET component, for use by multiple processes?

I would like to implement a component in .NET, and consume it in COM-aware clients via COM interop.
3737
3789

Background tasks fragments and “Can not perfom this action after onSaveInstanceState”

I have the following AsyncTask in a Fragment (the example is simplified for showing clearly the error):
1920

Avoid connection timeout when using multiple threads and connection pool

I'm splitting up a readonly database operation into multiple chunks, (Each of which reads a subset of a very large amount of data, analyzes it and writes the results to a disk file).
6947

Is 16 milliseconds an unusually long length of time for an unblocked thread running on Windows to be waiting for execution?

Recently I was doing some deep timing checks on a DirectShow application I have in Delphi 6, using the DSPACK components. As part of my diagnostics, I created a Critical Section class that adds a
9845

How can class method access be safely controlled in a C++ mutli threaded program using boost?

I want to translate some Java code into C++. One of the Java classes extends the Thread class and contains the following method:
9778

How I can put a lock around InputStream and release when reading is done

I want to put a Lock around java.io.InputStream Object and lock this stream. And when I am done finished reading I want to release the lock. How can I achieve this?
8192

MapReduce - Anything else except word-counting?

I have been looking at MapReduce and reading through various papers about it and applications of it, but, to me, it seems that MapReduce is only suitable for a very narrow class of scenarios that
7611

Forcing threads in a service to wait for another thread to finish

I'm writing a service that has five different methods that can take between 5 seconds and 5 minutes to run.
4883

Threads state after the program finishes execution

What happens to internal threads after the main thread finishes execution?
3346

Threadsafe UITableView

I'm using a UITableView to show some data from an array. This array can be changed at any time by other threads. (I believe that whether the array is mutable, or just replaced entirely, doesn't mak...
6462

What is the main thread in GCD?

What exactly is the main thread in Grand Central Dispatch? Is it a thread created when the program starts up (maybe just before the main() function gets called), which is arbitrarily called "the main
8757

UNIX threads - about sleep and how to make a thread work for certain time?

In UNIX, if a thread calls sleep function, will the entire process not do any work for that time or only the sleep calling thread will not do any work for that time?
1317

JApplet display

I am not sure what is wrong with my program. I think it might be a problem with threads, even though I am not creating Threads. What I have is three different classes to implement the game Minesw...
6573

Template function will not compile when called as a thread

I have a problem relating to template functions and threads:
1192

client number in a java multithread server

I use two classes in my server
7717

Expose a cancellable Task

I'm designing an API that exposes a cancellable Task, and want to make sure I have designed it correctly. Is there a standard pattern for exposing Tasks (maybe something similar to the APM
3702

Custom events in C# specifically is the sender object thread safe

Ok so I am working on implementing a set of custom events. They will primarially be used withing a multi-threaded environment to communicate major accomplishments throughout the threads. Now I have...
5968

SignalAndWait for lock-context

I have a manager class that produces tasks for a threadpool, and each thread is supposed to do a call back once they are finished.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.