multithreading

WCF Service with callbacks coming from background thread?

Here is my situation. I have written a WCF service which calls into one of our vendor's code bases to perform operations, such as Login, Logout, etc. A requirement of this operation is that we have a background thread to receive events as a result of that action. For example, the Login action is sent on the main thread. Then, several eve...

Will pool the connection help threading in sqlite (and how)?

I currently use a singleton to acces my database (see related question) but now when try to add some background processing everything fall apart. I read the sqlite docs and found that sqlite could work thread-safe, but each thread must have their own db connection. I try using egodatabase that promise a sqlite wrapper with thread safety ...

Boost Thread Hanging on _endthreadex

I think I am making a simple mistake, but since I noticed there are many boost experts here, I thought I would ask for help. I am trying to use boost threads(1_40) on windows xp. The main program loads a dll, starts the thread like so (note this is not in a class, the static does not mean static to a class but private to the file). ...

ScoreNinja causes java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()

I'm trying to add ScoreNinja, the global high score system, to my Android game, and it works fine when I load it on my phone, but when I release it into the wild, I got crash reports saying: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare() Here is part of the call stack: android.os.H...

Telerik Object reference not set to an instance of an object

Hi, I have a main form which contains multiple worker threads. These threads raise events which update Telerik controls on the main form. The event handlers contain code which check if InvokeRequired and BeginInvoke where required. At random interval I am receiving the following exception, and have no idea on how where to find this? I w...

.NET Windows Service, threads and garbage collection (possible memory leaks)

I am developing a .NET Windows service that is creating a couple of threads and then uses these threads to send print jobs to printers (there is a thread for each printer). I have some issues which sometimes can be fixed by restarting the service. Some issues also arise when the service has been running for a while. This makes me suspect...

C# WinForms MultiThreading in Loop

Scenario I have a background worker in my application that runs off and does a bunch of processing. I specifically used this implementation so as to keep my User Interface fluid and prevent it from freezing up. I want to keep the background worker, but inside that thread, spawn off ONLY 3 MORE threads - making them share the processing ...

What would be a good approach to use Thread or Thead Pool in ASP.NET

I am developing a component to create bespoke BulkImport functionality in ASP.NET. Underline this component will be using SqlBulkCopy class. There will be different file formats. The file is imported into a intermidiate table and is then transformed to the required tables. The upload file can be big and might take couple of minutes for p...

ThreadLocal (and Singleton) in EJB Container

I've written an authorization system which relies on objects representing the current user. To simplify programming and increase performance I want to hold those objects in a ThreadLocal after the user has logged in. It looks like this: public class UserCache { private static final ThreadLocal<User> cache = new ThreadLocal<User>(...

Calculate time of method execution and send to WCF service async

I need to implement time calculation for repository methods in my asp .net mvc project classes. The problem is that i need to send time calculation data to WCF Service which is time consuming. I think about threads which can help to cal WCF service asynchronously. But I have very little experience with it. Do I need to create new thread ...

An unspecified error occurred on the render thread. (NotifyPartitionIsZombie)

OK here's the problem, I have a ContentControl3D object from thriple in that im creating a LibraryStack with images it runs fine, until i run the function where the LibraryStack gets created and filled. when i click on any of the objects inside i get the following error An unspecified error occurred on the render thread. with stacktr...

Multithreading consulting service

Hello. I am creating a service, that needs to perform the following tasks: consult bank services and persist data into DB. The dificult is: Its needed to execute each process in parallel. I mean the better choice is implementing a multithreading service, running each instance per thread. But how its done? Thanks ...

How do I start a thread in a different security context?

How to start a thread in the security context of a different user? When a process starts a thread normally the security context is also passed but how to launch a thread in a different security context with the principal of a different user? ...

Java Synchronized List Deadlock

From Effective Java 2nd edition item 67 page 266-268: The background thread calls s.removeObserver, which attempts to lock observers, but it can’t acquire the lock, because the main thread already has the lock. All the while, the main thread is waiting for the background thread to finish removing the observer, which explains the dead...

How to efficiently save changes made in UI/main thread with Core Data?

So, there have been several posts here about importing and saving data from an external data source into Core Data. Apple documents a reasonable pattern for this: "import and save on background thread, merge saved objects to main thread." All fine and good. I have a related but different problem: the user is modifying data in the UI and...

Recursively adding threads to a Java thread pool

I am working on a tutorial for my Java concurrency course. The objective is to use thread pools to compute prime numbers in parallel. The design is based on the Sieve of Eratosthenes. It has an array of n bools, where n is the largest integer you are checking, and each element in the array represents one integer. True is prime, false is...

Multi-Threaded data insertion in MySQL using python

Hi, I am working on a project involving insertion a lot of data in to the database. I am wondering if anybody knows how to fill 2 or 3 tables in the database at the same time.An example or psueodecode would be helpful. Thanks ...

Thread safe lockfree mutual ByteArray queue

A byte stream should be transferred and there is one producer thread and a consumer one. Speed of producer is higher than consumer most of the time, and I need enough buffered data for QoS of my application. I read about my problem and there are solutions like shared buffer, PipeStream .NET class ... This class is going to be instantiate...

Any task-control algorithms programming practices?

Hi, I was just wondering if there's any field which concerns the task-control programming (or at least that's the way I call it). For a better explanation of task-control consider the following scenario: An application (master-thread) waits for a command - which might be a particular action or a set of actions the application should p...

Tab Page launching a timer

I have a project that uses a System.Timers.Timer to update the position of motors. I am adding 3 more motors and would like to control each of them the same way as the first. I tried moving my controls to a Tab Control but my update timers are not triggering. I made the UpdateTimer.SynchronizingObject = TheMainForm; Because if I t...