multithreading

Which vendors/companies have Multi-threaded Video codec solutions?

Hi, If its not relevant here, pls. move to correct place. I want to find out which all vendors/companies have developed multi-threaded video codecs(decoders , encoders) as commercial products? Not opensource solutions like libavcodec/x264/ffdshow etc... but commercial solutions for which one can obtain licenses/performance numbers of t...

System.Timers.Timer's SynchronizingObject property

1) What thread will the System.Timers.Timer's Elapsed event run on if I set the timer's SynchronizingObject property to null? 2) Will it run? What's a use case for it, if it does? I mean, in what situation will I want to run a timer on a non-UI thread/worker thread from the thread pool? ...

Java - Thread Synchronization in a web app

I have a web app where I load components lazily. There is a lot of static Bla bla; ... if(bla == null) bla = new Bla(); spread throughout the code. What do I need to do to make sure this is thread safe? Should I just wrap anytime I do one of these initializations in a synchronized block? Is there any problem with doing t...

How can I use parMap with a monadic function?

I have a monadic function getRate: getRate :: String -> IO Double I'd like to map this function over a list of String's. Normally, I would just do: mapM getRate ["foo", "bar"] but since each call to getRate makes network calls, I'd like to parallelize the map so that each rate is fetched in a separate thread (or at least spread ou...

C++ Confused about Threads

Basicly this is what I have: Server:: Server (int port) { cout << "Initializing server.\n"; (...) pthread_t newthread; pthread_create(&newthread, NULL, &Server::_startListening, NULL); cout << "Exit\n"; pthread_exit(NULL); // <-- Question } void* Server::_startListening (void* param) { cout << "Start l...

Do I need to call Close() on a ManualResetEvent?

I've been reading up on .NET Threading and was working on some code that uses a ManualResetEvent. I have found lots of code samples on the internet. However, when reading the documentation for WaitHandle, I saw the following: WaitHandle implements the Dispose pattern. See Implementing Finalize and Dispose to Clean Up Unmanaged ...

How to use LocalDataStoreSlot in asp.net

I know that LocalDataStoreSlot can be sued to stored thread scoped data. Now If I want to use it in asp.net, I want to Write following code during when web request begin string slotName = "xyz"; var slot = Thread.AllocateNamedDataSlot(slotName); Thread.SetData(slot, "some string"); so I can get the data in the same thread Now I forget...

Ruby/Glibc coredump (double free or corruption)

I am using a distributed continuous integration tool which I have written by myself in Ruby. It uses a fork of Mike Perham's "politics" for distribution of the tasks. The "politics" module is using threads for the mDNS part. Every now and then I encounter a core dump which I don't understand: *** glibc detected *** ruby: double free or...

VB.Net Multithreading - Please Code Review

I'm new to multithreading and need to make sure the demo code below is implemented correctly. The actual application I need to multithread will be very similar, except I will have to run possibly hundreds of concurrent threads. Please code review. Imports System.Threading Public Class FooBar Private myData As New List(Of String)()...

Should access to a shared resource be locked by a parent thread before spawning a child thread that accesses it?

If I have the following psuedocode: sharedVariable = somevalue; CreateThread(threadWhichUsesSharedVariable); Is it theoretically possible for a multicore CPU to execute code in threadWhichUsesSharedVariable() which reads the value of sharedVariable before the parent thread writes to it? For full theoretical avoidance of even the remote...

Will Python use all processors in thread mode?

While developing a Django app deployed on Apache mod_wsgi I found that in case of multithreading (Python threads; mod_wsgi processes=1 threads=8) Python won't use all available processors. With the multiprocessing approach (mod_wsgi processes=8 threads=1) all is fine and I can load my machine at full. So the question: is this Python beh...

Heavy weight and light weight thread

What are the Light weight and heavy weight threads in terms of java???? ...

Asynchronous HTTP Handler and using HttpContext in a background thread?

I was reading Walkthrough: Creating an Asynchronous HTTP Handler and noticed they pass the HttpContext from the handler thread and use it in a WaitCallback which runs on a background thread. It makes calls like _context.Response.Write(). Am I correct in assuming that this doesn't violate the fact that HttpContext is not thread safe bec...

Java thread affinity

Does anybody know of a way to lock down individual threads within a Java process to specific CPU cores (on Linux)? I've done this in C, but can't find how to do this in Java. My instincts are that this will require a JNI call, but I was hoping someone here might have some insight or might have done it before. Thanks! ...

Error handling patterns for multithreaded apps using WF?

I was writing up a long, detailed question, but just scrapped it in favor of a simpler question that I didn't find an answer to here. Brief app description: I have a WPF app that spawns several threads, and each thread executes its own WF. What are some of the best ways to handle errors in the threads and WF that will allow user inte...

Are static methods appropriate for a Linq To SQL DAL?

Hey, I'm using Linq to SQL for my DAL and have heard various things about using static methods in a web application (regarding threading/concurrency issues). At the moment, I created a test DAL, which seems to be functioning fine. However, are there any problems with the way I've created it, since it's static? public static class ...

What are these threads which are spwaned when a Java application begins its execution?

I have created a simple Java application which has a JFrame and few JButtons. When I tried to inspect the java application using JVMTI I found that though I did not create any explicit threads there were lot of them spawned. I could find the following threads: DestroyJavaVM AWT-EventQueue-0 AWT-Shutdown AWT-XAWT- Daemon Thread Java...

How do I stop a thread from terminating within a particular section of code?

I a total threading n00b and I want to figure out a way to shut down a thread first by asking nicely, then by force. I have a ProcessManager class that starts a bunch of Process class threads: public class ProcessManager { private IProcessRepository _processRepository; private List<Thread> _threads = new List<Thread>(); pu...

Why does ReaderWriterLock not auto release/exit when owner thread terminates?

This is a theoretical question; I don't have an actual issue to solve, I just want to understand the reasoning behind the way this works. I found out that if a thread omits to exit a ReaderWriterLock then other threads will fail to acquire a lock even after the original thread terminates. Is there a good reason why ReaderWriterLock doe...

How do I use Data.Concurrent.mergeio?

I see two functions mergeio and nmergeio in Data.Concurrent, but I can't find any examples of how they work. Has anyone worked with these before? My hope is that I can use these to get a function like "parMapM". ...