multithreading

Windows, multiple process vs multiple threads

hi, we have to make our system highly scalable and it has been developed for windows platform using VC++. Say initially, we would like to process 100 requests(from msmq) simultaneously. what would be the best approach. single process with 100 threads or 2 processes with 50-50 threads. What is the gain apart from process memory in case o...

std::future exception on gcc experimental implementation of C++0x

Hi all, I'm experimenting with C++0x threading, partially implemented in gcc 4.5 and I've got a problem, which I can't understand. Let's have a look on this code #include <future> #include <iostream> int main() { std::cout << std::async([]() { return 10; }).get() << std::endl; } it's quite simple and should work, but it's no...

Is there a way to detect when a QT QRunnable object is done?

Is there a way to detect when a QT QRunnable object is done? (Other than manually creating some signalling event at the end of the run() method.) ...

How can I synchronize three threads?

My app consist of the main-process and two threads, all running concurrently and making use of three fifo-queues: The fifo-q's are Qmain, Q1 and Q2. Internally the queues each use a counter that is incremented when an item is put into the queue, and decremented when an item is 'get'ed from the queue. The processing involve two threads,...

Java: merging InputStreams

Hello there, fellow members. I goal to create (or use existing) an InputStream implementation (say, MergeInputStream), that will try to read from a multiple InputStreams and return the first result. After that it will release block and stop reading from all InputStreams until next mergeInputStream.read() call. I was quite surprised, that...

Force QWebView to download web page content in a separate thread?

How can i force QWebView into downloading the webpage and related content in a separate thread? ...

.NET DataGridview scroll setting in another thread

i have a gridview whose scroll bars r selected "Both"......now this grid view in updated by a new datasouce in other thread.....but problem in when it is updated its vertical scroll bar diss appears and even not settled when i set it in other thread ...Here is the code Public Sub LoadList() dgvRFQs.DataSource = MyDal.GetAllQuotation...

starting and stopping threads from ASP.NET

Hi, I have to start a thread to do some long running task in the background (even if the browser is closed) without waiting for a response on a button click event of a web page and be able to stop that later if user wishes to do so. how can I do this? is it possible to store the id of the thread in database and abort it later? do I need ...

What is this error? System.Net.InternalException in Net.HttpWebRequest.SetAndOrProcessResponse

We are getting a really rare error during HTTP requests: System.Net.InternalException: System error. at System.Net.HttpWebRequest.SetAndOrProcessResponse(Object responseOrException) at System.Net.ConnectionReturnResult.SetResponses(ConnectionReturnResult returnResult) at System.Net.Connection.ReadComplete(Int32 bytesRead, WebExceptionSt...

background timer working only in one thread C#

hello, I have a kinda awkward problem, I'm working with C# and WPF in .NET 4.0 and what I need is a timer that will create only one thread but it will need to work in the background, so not in the main thread, the problem is using System.Windows.Forms.Timer or DispatchTimer will automatically force it to work on the main thread and be i...

Is this a good time to use multithreading in ASP.NET MVC and how is it implemented?

I want a certain action request to trigger a set of e-mail notifications. The user does something, and it sends the emails. However I do not want the user to wait for page response until the system generates and sends the e-mails. Should I use multithreading for this? Will this even work in ASP.NET MVC? I want the user to get a page resp...

Multiple threads in Android activity/service

Hi. I have an android app, where in a list view for each element in list, I load an image from web in a separate thread. So if there are 8 items displayed in list view, activity will try to fire 8 different threads, one for each list item to load an image. As you scroll down the list, the number of threads may increase if the previous t...

Fair comparison of fork() Vs Thread

I was having a discussion about the relative cost of fork() Vs thread() for parallelization of a task. We understand the basic differences between processes Vs Thread Thread: Easy to communicate between threads Fast context switching. Processes: Fault talarance. Communicating with parent not a real problem (open a pipe) Communica...

Non-blocking class in python (detached Thread)

Hello everyone... I'm trying to create a kind of non-blocking class in python, but I'm not sure how. I'd like a class to be a thread itself, detached from the main thread so other threads can interact with it. In a little example: #!/usr/bin/python2.4 import threading import time class Sample(threading.Thread): def __init__(sel...

WCF Concurrency

Good morning. I'm having concurrency issues. I've created a WCF service, and I've tested it to make sure that individual calls work just fine. Now I'm performing some load testing, and I'm seeing super high CPU utilization with long wait times for requests to be completed. My load testing tool is just a console application configur...

Logs queue in multithreaded application which dump information to DB (server side application)?

Could you advise me how to implements queue in multithreaded application. I have to register events in my application in queue (events from all users) which I flush and save to database every 100 events to improve performance. I don't want save database log for every single user commit. I suppose commit e.x. every 100 events to databas...

Looking for PostMessage functionality in Qt

The Win32 API has a PostMessage function that posts a message to the end of the GUI message queue to be processed later from the GUI thread, as opposed to SendMessage which sends and processes the message synchronous with the calling thread. Is there a Qt solution for PostMessage functionality? A coworker suggested that Qt's server/sock...

Is OpenGL threadsafe for multiple threads with distinct contexts?

I know that sharing a single context between threads is bad news. I know that I can safely create and use a context with an offscreen framebuffer on a secondary thread when nothing is happening with GL on the main thread. I haven't yet been able to find a definitive answer to the question of whether I can safely create two contexts on t...

Java: alternative to sleep in loop?

I need to listen to a serial input continuously, but NetBeans warns "Invoking Thread.sleep in loop can cause performance problems." I understand why this causes performance problems, but what is the best alternative in Java? public class SerialIO extends javax.swing.JFrame { ... class RcvTask extends Thread { public void...

How many threads can I spawn using boost in c++?

And what happens when I try to spawn too many? I'm getting the following error when I spawn more than about 900 threads: terminate called after throwing an instance of 'dining 1 boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::thread_resource_error> >dining 3 ' dining 2 what(): dining 4 boost:...