multithreading

Parallelism in Python

What are the options for achieving parallelism in Python? I want to perform a bunch of CPU bound calculations over some very large rasters, and would like to parallelise them. Coming from a C background, I am familiar with three approaches to parallelism: Message passing processes, possibly distributed across a cluster, e.g. MPI. Exp...

Queue access to the database to avoid multiple cache items

I have a music related ASP.NET web site which caches a lot of static information from the database on the first request. Sometimes, the application is reset and cache is cleared while the application is on heavy load and then all http requests go to the database to retrieve that static data and cache it for other requests. How can I en...

difference between thread.start() and executor.submit(thread)

hi, i am facing a problem regarding the thread. I am having a class which implements runnable, and i can use thread.start() method on that class. My question is i have one more class java.util.concurrent.ExecutorService in which i can call executor.submit(thread).. can anyone please tell me what is the difference between thread.start()...

Fast method call scheduling in Python

Hi all! For some part of my project I need a process-local scheduling system that will allow me to delay method execution on few seconds. I have thousands of “clients” of this system, so using threading.Timer for each delay is a bad idea because I will quickly reach OS thread limit. I've implemented a system that use only one thread for...

Timers and threading in Flex 3 ActionScript

Flex 3 ActionScript does not support programmer threads. But what does flash.utils.Timer do? Does it run in a separate thread or the main loop? If the latter, does that mean that the Timer might not be called if the main loop is in a long-running action? More generally, what can you tell me about threads running in ActionScript? My on...

ThreadStateException when using QueueUserWorkItem in a Timer

I have a ThreadStateException in my WinForms application. Step to reproduce: Create simple winforms app Add a Timer In click event, do : timer1.Interval = 1000; timer1.Tick += timer1_Tick; timer1.Start(); with void timer1_Tick(object sender, EventArgs e) { ThreadPool.QueueUserWorkItem(delegate { StringCollection pa...

What features make the functional language better for parallel programming?

The functional programming provides stateless way of programming that enables the user free of side effect. declarative way of programming that enables the user describe the problem sets that the computer should solve, not the way of the problems are solved. Combining those features, users can program in higher level that can be swa...

Using Suds for SOAP in python, are suds.client.Client objects thread safe?

I'm using Suds to access a SOAP web service from python. If I have multiple threading.Thread threads of execution, can each of them safely access the same suds.client.Client instance concurrently, or must I create separate Client objects for each thread? ...

How to determine which thread is created from another?

Is there any way in .NET for a thread to determine its 'parent', i.e. the thread that created it? I'm diagnosing a timing issue with a black box third party API and would like to find out what custom code of mine it is executing on which thread. ...

Is it multitasking?

Consider the below program myThread = new Thread( new ThreadStart( delegate { Method1(); Method2(); } ) ); I...

ThreadPooler in Spring 2.5.6

My application uses Spring 2.5.6. I have a service that creates explicit threads for some specific task. Triggering of this service call happens through quartz time scheduler. Question : While executing service calls, i want to use some sort of thread pooler that can return me thread instances. Is there any implementations that i can...

[gtk+] run function in another thread than gui

Hello, I have simple C/gtk+ application. I have function in this app which load image in gtkimageview widget: gboolean main_win_open( MainWin* mw, const char* file_path) { ... //loading and displaing image in gtkimageview ... } The loading image is work, but i need to run this function in another thread then main gui fo...

Executing SwingWorker from SwingWorker - waits until first one stops.

I'm trying to execute a SwingWorker (SubWorker) from another SwingWorker (MainWorker), and then I want the MainWorker to wait for the SubWorker to complete. In the mean time, the MainWorker should update itself according to property changes of the SubWorker. public class MainWorker extends SwingWorker<Void,Void> { public Void doInBa...

Using Quartz in an Asp.Net MVC environment using NHibernate Burrow

I have a web site running Burrow, and I'd like to use it for Quartz jobs as well. The thing is that I want them to not share any state. The Quartz jobs is running in each own threads while the Mvc framework closes the Workspace at the end of every request. Ideally, mvc should have it's own session, and each job should have it's own sess...

Java: design for using many executors services and only few threads

I need to run in parallel multiple threads to perform some tests. My 'test engine' will have n tests to perform, each one doing k sub-tests. Each test result is stored for a later usage. So I have n*k processes that can be ran concurrently. I'm trying to figure how to use the java concurrent tools efficiently. Right now I have an exe...

Will lock() statement block all threads in the proccess/appdomain?

Maybe the question sounds silly, but I don't understand 'something about threads and locking and I would like to get a confirmation (here's why I ask). So, if I have 10 servers and 10 request in the same time come to each server, that's 100 request across the farm. Without locking, thats 100 request to the database. If I do something l...

Windows Server 2003 provide network mutexes

Hi! I want to coordinate use of common files on Windows Server 2003 from two Windows XP Workstations. Does Windows Server 2003 provide network mutexes for this purpose? Are there any libraries of C functions to access to them? I couldn’t find such functions in Visual C++ 2008. ...

Java multithreading easiest way to run multiple methods at once?

Hi guys, I've never had to multithread before, I understand what it is at a basic level. I'm wondering what would be the simplest and most efficent way to execute three methods at once? e.g public void test(){ method1(); method2(); method3(); } Basically I want to execute 1,2 and 3 at the same time. I'm looking for any examples or r...

uh-oh windows mobile threading issues !

specifically WM6x, winCE5x Now my current understanding from trawling the msdn etal is that the IMAPIAdviseSink::OnNotify callback can be made from any old thread; from (ce)mapi or perhaps even from a third-party service provider. Under WM6x, i cannot seem to coax an in-thread response by invoking HrThisThreadAdviseSink, since while th...

What is the difference between Thread.Sleep(timeout) and ManualResetEvent.Wait(timeout)?

Both Thread.Sleep(timeout) and resetEvent.Wait(timeout) cause execution to pause for at least timeout milliseconds, so is there a difference between them? I know that Thread.Sleep causes the thread to give up the remainder of its time slice, thus possibly resulting in a sleep that lasts far longer than asked for. Does the Wait(timeout) m...