multithreading

delphi zip file within a thread (using TZipMaster)

Hello, I want to zip a file within a thread using the TZipMaster component. The problem is, when I run the program from the IDE I get the error (from windows) "the program doesn't respond anymore. -> Search online for a solution -> Close program" (or somehting like that I don't know the exact message in english.." However, t...

The thread tried to read from or write to a virtual address for which it does not have the appropriate access.

I have developed a .NET 2.0 extension that acts as a plug in to a 3rd party application. Everything runs fine when run on anything but Citrix. When run over Citrix as a published application the extension crashes randomly which also crashes the 3rd party application. I have opened up a dump file and have found an exception message that...

Thread Renaming

In Java, renaming threads is possible. In .NET it is not. This is because the Name is a property that is write-once in the Thread class: public string Name { get { return this.m_Name; } [HostProtection(SecurityAction.LinkDemand, ExternalThreading=true)] set { lock (this) { if (...

Questions on simple threading jargons

When a manual-reset event is signaled, all threads waiting on the event become schedulable. When an auto-reset event is signaled, only one of the threads waiting on the event becomes schedulable. I have some really noob questions here to ask, as I'm new to threading. What does it mean to "set" and "reset" an event? What ...

Which Java collection should I use to implement a thread-safe cache?

I'm looking to implement a simple cache without doing too much work (naturally). It seems to me that one of the standard Java collections ought to suffice, with a little extra work. Specifically, I'm storing responses from a server, and the keys can either be the request URL string or a hash code generated from the URL. I originally t...

Instance variable of Activity not being set in onPostExecute of AsyncTask or how to return data from AsyncTask to main UI thread

I'm trying to figure out the correct way to create an AsyncTask to retrieve some data from the internet and then to take that data and bundle it up in an Intent and pass it to a new activity(A list display). So in the first activity I just have an EditText and Button. In the event of an OnClick the task should be called and when it is ...

implementing a basic queue/thread process within python

hi.. looking for some eyeballs to verifiy that the following chunk of psuedo python makes sense. i'm looking to spawn a number of threads to implement some inproc functions as fast as possible. the idea is to spawn the threads in the master loop, so the app will run the threads simultaneously in a parallel/concurrent manner chunk of co...

multiple webbrowser control and multiple threads

Hi, My app contains 2 webbrowsers and 2 threads. The browsers run separate on each thread. Both have been added to the Form in a tabcontrol on different tabpages. Also got their own document_complete1 and 2 event. The problem is, only 1 webbrowser has documentText after WebBrowserDocumentCompletedEventArgs event fires which is the webb...

Should I use Hibernate with this multi-threaded architecture or abandon it?

My software uses multiple threads to do its work. There is a pipeline that looks something like this: +-----------------+ |+-----------------+ +------------+ ||+-----------------+ +------------+ | | ||| | | | | Get and | ||| Worker Threa...

limited multithreaded operation

I have a procedure (procA) which needs to call a webservice many times and then return the set of results. procA may be called a handful of times concurrently. the calls to the webservice take a set amount of time, however concurrent calls do not greatly impact the performance. therefore it would be beneficial to create a thread pool ...

TimerCallback Delegate to drive an STA model .NET library component

I'm trying to use the TimerCallback Delegate mechanism to drive instances of objects from a 3rd party .NET library component on separate threads executing on a timed basis. When I try to create an instance of an object from the library I an exception is raised: (object name) can only be called from a single-threaded apartment (STA...

thread intrinsic lock

When we talk about intrinsic lock we refer to the object for which we ask the lock or for the synchronized method? The lock is on the object or on it's sync method? I'm confused! ...

Weird problems on iPhone simulator but not device?

I'm having some problems with the iPhone simulator that don't seem to be occurring on the device. I have made a web service reference class with a bunch of static methods so different calls to a web service can be made from all over the application. The methods themselves contain a lock so only one request will be performed at a time. ...

NSOperationQueue queue waitUntilAllOperationsAreFinished hangs

I have an iphone app where on the loading of a view controller, I want to call a web service , get and parse XML all on the background thread. Then update the ui after the thread is done, then fire off another thread to do a secondard operation in another background thread. Sort of like chaining threading calls: UI Thread -> Create BG...

Is LinkedList thread-safe when I'm accessing it with offer and poll exclusively?

Hi, I have a linked list samples: protected LinkedList<RawDataset> samples = new LinkedList<RawDataset>(); I'm appending elements to the list in thread 1 like this: this.samples.offer(data); And I'm retrieving elements from it in a second thread like so: public RawDataset retrieveSample() { return this.samples.poll(); } Wou...

what's a monitor?

What's a monitor referred to the concurrent programming in Java? When I read that "every object has associated a monitor" what does it meaning? Is it a special object? ...

Progressbar in Android

Can I use progress bar in android, without the thread? HERE IS CODE OF MY CURRENT WAY OF IMPLEMENTING PROGRESS DIALOG // Adding Progress bar String[][] data; //Global variable //called on onCreate() or onItemSelected final ProgressDialog myProgressDialog; myProgressDi...

What's harder, synchronizing 2 threads or 1000 threads?

On Paul Tyma's presentation, I found an interview question: What's harder, synchronizing 2 threads or synchronizing 1000 threads? From my perspective, of course synchronizing 1000 threads is harder, but I can't think of a good reasons for that beside 'of course'. But since it's interview question, may be I'm wrong (interview questi...

is with_scope threadsafe?

Poking around in the rails code, I ran across with_scope. From what I can tell, it takes the scope type and conditions, merges them into existing conditions for that scope type, yields to the block, then gets rid of the additional scope. So my first thought is in a multithreaded environment (like jruby on rails), what happens if while...

Implementation of a web-server

I had like to implement my own web-server in pure Java the web-server should support only static resources (i.e. html, js, css, pics, movies etc..) Can you recommend a tutorial or an article on how to implement such a thing? should I use few processes or a thread-pool or should I consider a loop-event oriented like NodeJS? I know there...