multithreading

What's wrong with using Thread.Abort()

So I know that you shouldn't use Thread.Abort() But I've never been given a good explanation. Is there a performance penalty or some hidden gotcha? I know you can't ignore/swallow the ThreadAbortException (which makes sense) ...

CSharp : Monitor - Wait,Pulse,PulseAll

I am having hard time in understanding Wait(),Pulse(),PulseAll(). Will all of them avoid Deadlock ? I would appreciate if you programmatically explain how to use them? ...

How to display progressbar during copy

Hi I have C# form which provided with button and picturebox this button have main job which is (open dialog to choose file) after that this file will be copy to specific folder if this file was huge I need my form display progress bar and increase until file copied "How I can do that" ...

High CSwitch ("context switch") when using Boost interprocess code (on Windows, Win32)

Hi, I'm writing a multithreaded app. I was using the boost::interprocess classes (version 1.36.0) Essentially, I have worker threads that need to be notified when work is available for them to do. I tried both the "semaphore" and "condition" approaches. In both cases, the CSwitch (context switch) for the worker threads seemed very h...

How does HttpContext.Current work in a multi-threaded environment?

So I'm left wondering how exactly asp.net is able to scope a static property, when (to my knowledge) asp.net is multi-threaded. One theory goes that the ASP.NET guys maintain a different appdomain for every request ... but that doesn't seem feasible. Another theory goes that the .Current method looks at the current Thread, and then use...

Help needed in Monitor.PulseAll()

can anybody explain me with simple example to handle Monitor.PulseAll().I have already gone some examples from this stackoverflow.As i am a beginner i feel those are above my head. ...

problem handling db conection on daemonize threads...

Just for the record, i just started programing on python, and this is the first time i try to do a daemon. I have a problem handling DB connections in a daemon i've been working on, the first thing i do, is connect to my postgres db with: try: psycopg2.apilevel = '2.0' psycopg2.threadsafety = 3 cnx = psycopg2.connect( "host='192....

Using SSRS 2008 web service calls across multiple threads

I'm trying to create a multi-threaded service that will render a large volume of reports to multiple output sources (file, ftp, email, etc), but I've run into a large problem. With SSRS 2000, render is a single call, allowing for each independent thread to run its own render. But with 2005 and 2008, Microsoft decided to split this into...

How to stop threads of a Java program?

I have made a java program with GUI and have placed a "stop" button on it. When I start the program, the main thread starts 10 threads. Now I want that whenever a user click on "stop" button, all the threads should terminate first, then the main thread should terminate. How can I do that. ...

Making Java Tic Tac Toe Server Multithreaded

Hey everyone, I have no experience with threads, unfortunately. I have been doing a couple of "Hello World" thread examples, which seem to be pretty easy. However, I need to incorporate threads into a Java Tic Tac Toe server that I have (which uses sockets). The design of my Tic Tac Toe game is this: Provider.java (server): Determin...

Fastest implementation of one thread providing data, many threads consuming data

I have a lot of data that I want to disseminate to many different threads. This data is coming from a single thread. The consuming threads can safely access the container simultaneously. The data needs to be merged into the container ever delta seconds (50ms < delta < 1), during which time the consuming threads need to be locked out, ...

How to preload images in a separate thread but use them in UIImageView?

AFAIK, a thread can not access UI components. But I want to preload images in a background thread and then display these in an UIImageView. Do I have to use special methods to access UIImageView in the main thread then? ...

Is this a memory management problem when using multiple threads?

Example: In my main thread (the thread that's just there without doing anything special) I call a selector to be performed in a background thread. So there's a new thread, right? And now, inside this background thread I create a new object which holds image data. Next I use that object and want to keep it around for a while. How would I ...

C# Threading: Using Monitor.Wait, Lock and PulseAll

I am new to CSharp and Threading. To be familiar with Monitor.Wait,Monitor.lock and Monitor.PulseAll,I framed a scenario described below. "A FootballGround is being shared by different teams for practicing purpose. At any time only one team can use the ground for their practice. A team can use the ground for 30 minutes for their prac...

Terminating a specific thread from a Multi-Threading program in Java

Am working on a program in Java as shown below, the class is simply executing commands into the operating system level. Yet, sometimes we are facing a problem where the program get stuck, so the command never return any status, thus the thread does not terminate. Now am trying to enhance the code, add an additional thing where I can kil...

Queue of NSOperations and handling application exit

Hi there, I'm about to create a series of NSOperations and run them in a queue. They will all be sequential and run one at a time. These operations will fetch data from the web and create and save core data managed objects. How do I handle the situation where the application exits? As the operations run in detached threads, how can I...

Run multiple UI Threads

Skip to the bottom for the question; this is just some extra info I am using a component (GeckoFX) to render some websites, well fine, yet it can only be used in a Windows Form; as it has to bind to a WinForms object that can be drawn. Because all the WinForms are running in the same thread, I can only use one GeckoFX instance at a time...

Proper way to have an endless worker thread?

I have an object that requires a lot of initialization (1-2 seconds on a beefy machine). Though once it is initialized it only takes about 20 miliseconds to do a typical "job" In order to prevent it from being re-initialized every time an app wants to use it (which could be 50 times a second or not at all for minutes in typical usage), ...

Convert Keith Hill's PowerShell Get-Clipboard and Set-Clipboard to a PSM1 script

I'd like to convert Keith Hill's C# implementation of Get-Clipboard and Set-Clipboard into pure PowerShell as a .PSM1 file. Is there a way to spin up an STA thread in PowerShell as he does in his Cmdlet when working with the clipboard? The Blog Post The Code ...

thread level memory consumption of process

How do I get per thread based memory consumption of a process in Linux? I understand that we can use /proc/pid/task/tid/statm, but thats not helping my case. All the threads show same value and its same as PID's statm. We can do valgrind but I am not looking for any invalid read/write or leaks. Valgrind will not tell me any thread leve...