multithreading

Silverlight Threading and its usage

Hello Experts, Scenario : I am working on LOB application, as in silverlight every call to service is Async so automatically UI is not blocked when the request is processed at server side. Silverlight also supports threading as per my understanding if you are developing LOB application threads are most useful when you need to do some I...

Thread aborted exception in ajax...while downloading excel file from server.

I have a Carousel ..in which I have different images...and on clicking one image...it will call a webmethod through AJAX....and will down load excel sheet with "save/open/saveas" options...that is using following code. Response.ClearHeaders(); Response.Clear(); Response.AddHeader("Content-Disposition", "attachment; filename=r.xls"); Res...

java thread which is better way?

while creating a thread in java, there is two ways such as Extending threads and Implement runnable Interface. I am unaware of Which is the better way of creating threads? ...

Multithreading in Bash

I would to introduce multithreading feature in my shell script. I have a script which calls the function read_cfg() with different arguments. Each of these function calls are independent. Would it be possible to instantiate these function calls (not scripts) parallelly. Please let me how can we achieve that.. ? ...

How well-suited is openMP for parallelizing a chunk of code that is run many times a second?

Say you have a typical game-loop, running about 30 times a second. One particular function takes about 50% of the time and looks like a prime candidate for parallelization - say it's a big loop or there are 4 distinct and independent strands of work going on. Assume we already checked that the function itself can parallelize well in isol...

Can IfxConnection and threading get along?

We have an application using the IBM Informix driver. Whenever we try to open connections in parallel, we start getting some really weird errors. This is the smallest reproduction code I could come up with: const int Count = 10; const string ConnectionString = "Host=the_host;Service=the_service;Server=the_server;Database=the_database;U...

Windows Form hangs when running threads

JI have written a .NET C# Windows Form app in Visual Studio 2008 that uses a Semaphore to run multiple jobs as threads when the Start button is pressed. It’s experiencing an issue where the Form goes into a comma after being run for 40 minutes or more. The log files indicate that the current jobs complete, it picks a new job from the li...

How do I run two threads in Ruby at the same time?

Is there some way to run 2 threads at the same time? I want to have my app run its current function and then bring up another thread running another function, that can change variables in the first thread. ...

Are rails timers reliable when using Net::HTTP?

Hi All. When reading data from a potentially slow website, I want to ensure that get_response can not hang, and so added a timer to timeout after x seconds. So far, so good. I then read http://ph7spot.com/musings/system-timer which illustrates that in certain situations timer.rb doesn't work due to ruby's implementation of threads. Doe...

Form.Show() is not showing it's child controls

I have a form, frmPleaseWait, that has a MarqueeProgressBar and a Label that I want to use when the UI is loading the data in a poorly structured app we have. The problem is that frmPleaseWait.Show() shows the form but not the controls in it. It is just a white rectangle. Now frmPleaseWait.ShowDialog() shows the child controls but d...

Multiple Progress Bar

Hello, In addition to my previous query concerning multi-threading in shell scripting I am curious if its possible to have multiple progress bar. Here is a code snippet of my expected result : Output : 1 of 100 Files Completed # Thread1 Output : 10 of 45 files Completed # Thread 2 The lines are updated showing the progre...

How do I create a thread-safe write-once read-many value in Java?

This is a problem I encounter frequently in working with more complex systems and which I have never figured out a good way to solve. It usually involves variations on the theme of a shared object whose construction and initialization are necessarily two distinct steps. This is generally because of architectural requirements, similar t...

Concurrent reading and writing to NamePipeClientStream

I have a NamedPipeClientStream instance in my application that is setup for duplex communication (PipeDirection.InOut). I also have two threads, a read thread and a write thread. I want to have the read thread call only the NamedPipeClientStream.Read method, and the write thread only call the NamedPipeClientStream.Write method. They w...

C++ Managing Shared Object's Handle issues

Is there best practice for managing Object shared by 2 or more others Object. Even when running on different thread? For example A is created and a pointer to it is given to B and C. ObjA A = new ObjA(); B->GiveObj(A); C->GiveObj(A); Now how can I delete objA? So far what I though about is A monitor how many ref there are to it and w...

iPhone: One Object, One Thread

On the iPhone, I would like to do some operations on an image in a separate thread. Rather than dealing with semiphores, locking, etc., I'd like to use the 'One Object, One Thread' method of safely writing this concurrent operation. I'm not sure what is the correct way to copy my object into a new thread so that the object is not acces...

pthread_exit and/or pthread_join causing Abort and SegFaults.

The following code is a simple thread game, that switches between threads causing the timer to decrease. It works fine for 3 threads, causes and Abort(core dumped) for 4 threads, and causes a seg fault for 5 or more threads. Anyone have any idea why this might be happening? #include <stdio.h> #include <stdlib.h> #include <pthread.h> ...

C# Is it possible to interrupt a specific thread inside a ThreadPool?

Suppose that I've queued a work item in a ThreadPool, but the work item blocks if there is no data to process (reading from a BlockingQueue). If the queue is empty and there will be no more work going into the queue, then I must call the Thread.Interrupt method if I want to interrupt the blocking task, but how does one do the same thing...

Threading in C#

Hi, I have console application. In that i have some process that fetch the data from database through different layers ( business and Data access). stores the fetched data in respective objects. Like if data is fetched for student then this data will store (assigned ) to Student object. same for school. and them a delegate call the cer...

C# How to pause/suspend a thread then continue it?

I am making an application in C# which uses a winform as the GUI and a separate thread which is running in the background automatically changing things. Ex: public void run() { while(true) { printMessageOnGui("Hey"); Thread.Sleep(2000); . . } } How would I make it pause any...

Does Monitor.Wait ensure that fields are re-read?

It is generally accepted (I believe!) that a lock will force any values from fields to be reloaded (essentially acting as a memory-barrier or fence - my terminology in this area gets a bit loose, I'm afraid), with the consequence that fields that are only ever accessed inside a lock do not themselves need to be volatile. (If I'm wrong a...