multithreading

Can i call multiple times JNI_CreateJavaVM ?

Hello I´m Trying to launch two threads witch calls "DispFrontEnd" function First thread ended OK, second failed to start jvm.. ?? tks #include "jni.h" #include <process.h> #include "Stdafx.h" //DISPATCH Thread Check bool DispatchThreadCreated = FALSE; if (DispatchThreadCreated == FALSE) { HANDLE hDispThread; hDispThread = (H...

What's the easiest way of making several web requests in a row ?

I have a given list of URL's, and i make an HTTP web request object, and try to connect with it, i have an 'array' of url's, and i try to connect with each one. the objective is seeing which ones are out. It already works, but one request only starts as soon as the last one ends, so it's quite a slow working, about two requests per seco...

Thread Abort in .NET

I have a thread thats analyzing a file and making transactional calls to the database, each transaction has a audit entry as part of its transaction. Is there anything vastly wrong with calling Thread.Abort() to stop the processing of the file? Rather than scatter ugly safe spots everywhere? The file will be closed after the Abort call...

In C++, are static initializations of primitive types to constant values thread-safe?

i.e., would the following be expected to execute correctly even in a multithreaded environment? int dostuff(void) { static int somevalue = 12345; return somevalue; } Or is it possible for multiple threads to call this, and one call to return whatever garbage was at &somevalue before execution began? ...

Proper way to handle thousands of calls to external service from asp.net (mvc)

Hi, I'm tasked to create a web application. I'm currently using c# & asp.net (mvc - but i doubt its relevant to the question) - am a rookie developer and somewhat new to .net. Part of the logic in the application im building is to make requests to an external smsgateway by means of hitting a particular url with a request - either as pa...

Waiting for either of these BackgroundWorker to complete

Hi... There is a sequence for FORM(some UI) should get downloaded using service. Currently, this download is in a BackgroundWorker Thread. Now, since the performance is slow... We decided to categories the FORMS into 2 and start downloading parallely using another BackgroundWorker on top of the existing Thread. Now, the scenario is t...

Select mutex or dummy mutex at runtime

I have a class that is shared between several projects, some uses of it are single-threaded and some are multi-threaded. The single-threaded users don't want the overhead of mutex locking, and the multi-threaded users don't want to do their own locking and want to be able to optionally run in "single-threaded mode." So I would like to ...

How do you make QT threads in python for pyqt?

I see discussion about qt threads vs python threads but how do you create and call qt threads in python? how do you give it access to your functions in another thread? Thanks! ...

How to wait in the main thread until all worker threads have completed in Qt?

Hi, I have designed an application which is running 20 instance of a thread. for(int i = 0;i<20;i++) { threadObj[i].start(); } How can I wait in the main thread until those 20 threads finish? ...

Get a thread by its name

Hello Two questions, I want to give a thread a name and retrieve it to check whether it is alive how to do that? I want to do that in asp.net application at BLL layer so I don't have a timeout exception. Is that a bad idea? Thanks ...

android runnable difference

What is the different b/w running runnable inside handler new Handler().post(runnable) and running in Thread(runable) ? ...

BackgroundWorkers never stop being busy

for (do it a bunch of times) { while (backgroundWorker1.IsBusy && backgroundWorker2.IsBusy && backgroundWorker3.IsBusy && backgroundWorker4.IsBusy && backgroundWorker5.IsBusy) { System.Threading.Thread.Sleep(0001); } if (!backgroundWorker1.IsBusy) { ba...

Is this really returning a local addess?

I have some code which creates a synchronised queue which I use in a data gathering class to report it's data. The method which creates queues is kicking up a warning: Queue^% DataGatherer::AddOutputQueue() { Queue^ outputQueue = Queue::Synchronized(gcnew Queue); AddOutputQueue(outputQueue); return outputQueue; } 1>.\Da...

accessing a System.Data.DataRow object in a multithreaded program

Hi, i am trying to extract a single row of data from a DataSet. Unfortunately since this program is multithreaded any changes made in a different thread to the DataSet are carried over to my separate DataRow object. I'm declaring the DataRow as below: Dim DR As System.Data.DataRow = DS.Tables(0).Rows(0) I SyncLock DS during the declar...

Non-deterministic programming languages

I know in Prolog you can do something like someFunction(List) :- someOtherFunction(X, List) doSomethingWith(X) % and so on This will not iterate over every element in List; instead, it will branch off into different "machines" (by using multiple threads, backtracking on a single thread, creating parallel universes or what...

Reliable n-Tier WCF (Threading issue?)

I am working on an n-Tier application using WCF between the layers such that: Tier 1: Silverlight application Invokes the search request IClientBroker clientBroker = UIContext.CreateWcfInterface<IClientBroker>("Data/ClientBroker.svc"); clientBroker.BeginSearchForClients(SearchTerm, 20, (result) => { ...

multithreading loop effecient?right?

I have the following multithreading function to implement threads fetching from a list of urls to parse content. The code was suggested by a user and I just want to know if this is an efficient way of implementing what I need to do. I am running the code now and getting errors on all functions that worked fine doing single thread. for ex...

Multithreading with pyqt - Can't get the separate threads running at the same time?

I am trying to get a PyQT GUI running ontop of my python application and I have tried to get it separated into 2 threads so the GUI would be responsive while my main running loop goes, but I have not been able to get it going. Maybe I am misunderstanding it. Here is what I've tried: My Window and Worker thread are defined as follows: ...

Thread safe locale techniques

We're currently writing a web application based on a threaded python web server framework (cherrypy) and would like to simultaneously support users from multiple locales. The locale module doesn't appear to be thread safe. Are there 3rd party libraries or modules that provide locale parsing and formatting functionality in a thread-safe ...

How can I SIMPLY perform two tasks at once in my iPhone app? (threading?)

The Situation: Somewhere in my app I start downloading data from my server. Before downloading starts, I would like to update a UILabel to say @"Now Downloading...". And set it back to blank when downloading is over. The Problem: It seems like the download takes up all of the computers attention, and the UILabel never gets updated unt...