multithreading

If 256 threads give better performance than 8 have I likely got the wrong approach?

I've just started programming with POSIX threads on dual-core x86_64 Linux system. It seems that 256 threads is about the optimum for performance with the way I've done it. I'm wondering how this could be? And if it could mean that my approach is wrong and a better approach would require far fewer threads and be just as fast or faster? ...

WebView threads never stop (WebViewCoreThread, CookieSyncManager, http[0-3])

I use a WebView to display some internet content on one of our app's Activities. The problem is that when the user switches out of this activity, WebView's threads keep running! The problematic threads are: Thread [<17> WebViewCoreThread] (Running) Thread [<25> CookieSyncManager] (Running) Thread [<19> http0] (Running) Thread [<29> http...

Regarding threads in Linux

How many threads a single process can handle in Linux(RHEL-5)? Once threads are created how much stack an each thread can get ? ...

Objective-C NSThread ref counting convention (retain vs autorelease)

My main program spawns a thread, which executes the following: // alloc autorelease pool somewhere before NSArray *blah = [NSArray arrayWithObject: @"moo"]; [self performSelectorOnMainThread: @selector(boonk:) withObject: blah waitUntilDone: NO]; // release autorelease pool somewhere after Now, this seems buggy to me because the...

How to prevent rows in datagrid from flickering while application is running

In the application I'm developing at the moment I'm using a datagridview to display data. To fill it, I've to press a button and a backgroundworker will start running, it will fill a datatable and when it's finished running it will use the datatable as the datasource for the datagrid. This works fine, the UI stays responsive et cetera. B...

In Silverlight, how do you find out whether the code is running in the UI thread or not?

Basically I need to know whether I need to can Dispatcher.BeginInvoke or if it's not needed. Thanks. ...

WebClient.DownloadFileAsync - Download files one at a time

Hello All, I am using the code below to download multiple attachments from a TFS server: foreach (Attachment a in wi.Attachments) { WebClient wc = new WebClient(); wc.Credentials = (ICredentials)netCred; wc.DownloadFileCompleted += new AsyncCompletedEventHandler(wc_DownloadFileCompleted); wc.DownloadFileAsync(a.Uri,...

Fireing Android Dialogs from another thread without Message Loop

In a SurfaceView, I'm dispatching new thread that draws on canvas within standard "LockCanvas-Draw-unlockCanvasAndPost" loop. (note that thread doesn't contains message loop). How to show Android standard Dialog from that thread? As thread doesn't have msg loop, following code doesn't work: Builder builder = new AlertDialog.Builder(th...

parallel c# threading performance issues

This code is for transforming from colored to black and white. I tried to add parallel section to the code just transforming from gray-scale to black-white i tried to assign to each thread a number of cols which has amount of pixels but the performance didnt improve at all. I tried for a 800*600 image by changing the divisor value (...

Is a lock necessary in this situation?

Is it necessary to protect access to a single variable of a reference type in a multi-threaded application? I currently lock that variable like this: private readonly object _lock = new object(); private MyType _value; public MyType Value { get { lock (_lock) return _value; } set { lock (_lock) _value = value; } } But I'm wonderin...

Asynchronous Writes To Textbox in C# are Overwritten

Hello. I have an application wherein two threads write asynchronously to a single textbox. It works, except that the second thread to write to the textbox overwrites the line that the first thread just wrote. Any thoughts or insight into the problem would be greatly appreciated. I am using Microsoft Visual C# 2008 Express Edition. T...

MPQueue - what is it and how do I use it?

I encountered a bug that has me beat. Fortunately, I found a work around here (not necessary reading to answer this q) - http://lists.apple.com/archives/quartz-dev/2009/Oct/msg00088.html The problem is, I don't understand all of it. I am ok with the event taps etc, but I am supposed to 'set up a thread-safe queue) using MPQueue, add ...

How might one create an extra worker thread for a single threaded GUI application?

I am currently developing new features for an existing VCL application. The application creates charts and static images using a thirdparty package called TeeChart. There is one instance where I have to load in 2 million data points to create a static image chart. However, this takes a while to load and the user can't do anything in the ...

ASP.NET, C#: put lock block around a section

Hi folks: I intend to around existing code snippet (updating a Hashtable) with lock() block to prevent multiple threads (launched by ASP.NET web site) from simultaneously updating a Hashtable. B\c this is first time I do in this measure, I need your advice on Any performance overhead caution caused by lock() Any other issues you ev...

Threads on WindowsXP

If there are child threads of a parent thread running on the windows xp OS, does terminating a parent thread terminate its child thread as well? ...

Can BeginInvoke interrupt code already running on the UI thread?

Suppose I have some code which is running in the UI thread, which spawns a new thread to do work in the background, and then goes on to do UI work. When the background work is done, BeginInvoke is called from the new thread. If the UI work is still going on, will the callback given to BeginInvoke interrupt the UI work, or will it wait?...

thread start address

How can i identify exact location in a method with the following information: "abcd.dll!CMyclass::CMymethod+0x45" Actually this is the start address of a thread, i got this string as a start address for a thread with the help of a process monitoring tool. Thanks. ...

Thread Communication

Is there any tool available for tracing communication among threads; 1. running in a single process 2. running in different processes (IPC) ...

In Silverlight, will navigating away from the page that contains a thread end the thread?

I have a Silverlight 3 project. When one of the pages is loaded, a System.Threading.Thread object is created and started. I want to make sure that it terminates when the user navigates away from the page. Will this happen automatically, or do I have to manually terminate the thread in the OnNavigatingFrom event? Thanks for any help. ...

Thread Pool vs Thread Spawning

Can someone list some comparison points between Thread Spawning vs Thread Pooling, which one is better? ...