multithreading

What is the use of Thread.BeginThreadAffinity() method in Thread class ?

What is the use of Thread.BeginThreadAffinity() method in Thread class ? It will be helpful for me to understand if you provide its sample example with exaplaination. Thanks. ...

Threading: problem with checkbox's visibility

In a C#.NET windows application I set the visibility of the checkbox to false: checkBoxLaunch.Visible = true; I started a thread. Thread th = new Thread(new ThreadStart(PerformAction)); th.IsBackground = true; th.Start(); The thread performs some stuff and sets the visibility to true private void PerformAction() { /* . .// some ...

how to see thread structure in .net ?

Is this possible in .net to see visually ,thread structure those are running (in multithreading) ? if yes , how can i see that ...

What is the difference between thread affinity and process affinity?

What is the difference between thread affinity and process affinity? If I have two threads and I have a dual core machine then is it possible to run these two threads in parallel on the two cores? If I use processor affinity mask then I can control execution of a process on the cores but when I have to run threads on a particular core ...

Why the performance of following code is degrading when I use threads ?

Why the performance of following code is degrading when I use threads ? **1.Without threads int[] arr = new int[100000000]; //Array elements - [0][1][2][3]---[100000000-1] addWithOutThreading(arr); // Time required for this operation - 1.16 sec Definition for addWithOutThreading public void addWithOutThreading(int[] a...

[C++/Boost] "Unhandled exception" error when using a loop inside thread

Hello there, I got this error Unhandled exception at 0x0049b946 in Program.exe: 0xC0000005: Access violation reading location 0x00000090. and the error points to this line: // thread.hpp ln 56 void run() { f(); // here << } When trying to run this code: void frameFunc() { for(;;) ...

Tree structures and threads

I have a speed critical multithreaded program which involves data in a tree structure. Implemented as follows: typedef struct { // data pertaining to linkages, defining the architecture of the tree int parent_node; int child_node[MAX_CHILD_NODES]; int number_of_children; // data pertaining to info at each node f...

Partially constructed object / Multi threading

Heya! I'm using joda due to it's good reputation regarding multi threading. It goes great distances to make multi threaded date handling efficient, for example by making all Date/Time/DateTime objects immutable. But here's a situation where I'm not sure if Joda is really doing the right thing. It probably does, but I'm very interested ...

How Can I Set Processor Affinity in .NET?

Can we set two thread or two task to execute with different processor affinity in C# Application? I have read about SetThreadAffinityMask but there is no example to have that used.. or Is there any way TPL(Task Parallel Libray) executes two thread/Task in with high priority to use 100% cpu ? ...

Unresponsive UI when using BeginInvoke

Bckground I have a networked application written in C#. my server program has a UI and several communication threads, that read from tcp sockets and display messages on controller UI. Communication with each client is done through a seprate thread. When i recieve some stream of messages from one client , the thread for that client write...

What are the differences between currently executing .NET thread and Win32 thread

I am reading the Asp.net security documentation on msdn.I come across these tow terms and get really confused. # WindowsIdentity = WindowsIdentity.GetCurrent() which returns the identity of the security context of the currently executing Win32 thread. # Thread = Thread.CurrentPrincipal which returns the principal of the currently ...

SwingWorker in Java (beginner question)

I am relatively new to multi-threading and want to execute a background task using a Swingworker thread - the method that is called does not actually return anything but I would like to be notified when it has completed. From all the tutorials that I have seen online about using SwingWorkers are created such as new SwingWorker<String, ...

Using a Cross Thread Boolean to Abort Thread

Possible Duplicate: Can a C# thread really cache a value and ignore changes to that value on other threads? Lets say we have this code: bool KeepGoing = true; DataInThread = new Thread(new ThreadStart(DataInThreadMethod)); DataInThread.Start(); //bla bla time goes on KeepGoing = false; private void DataInThreadMethod() { ...

Delphi threads deadlock

I am having a problem sometimes with a deadlock when destroying some threads. I've tried to debug the problem but the deadlock never seems to exist when debugging in the IDE, perhaps because of the low speed of the events in the IDE. The problem: The main thread creates several threads when the application starts. The threads are alway...

Effective thread Synchronization in C#

I have a scenario where I need to search from many binary files (using keys) and combine the results (strings). Until now, I have been doing it in a for loop one file after the other. foreach (string file in FileSources.Keys) { aggregatedDefinitions.Append(DefinitionLookup(txtSearchWord.Text, file)); } Since this operation is very...

How can two threads access a common array of buffers with minimal blocking ? (c#)

Hello, I'm working on an image processing application where I have two threads on top of my main thread: 1 - CameraThread that captures images from the webcam and writes them into a buffer 2 - ImageProcessingThread that takes the latest image from that buffer for filtering. The reason why this is multithreaded is because speed is cri...

C++ using this pointer in constructors

In c++, during a class constructor, I started a new thread with 'this' pointer as a parameter which will be used in the thread extensively (say, calling member functions). Is that a bad thing to do? Why and what are the consequences? Edit: my thread start process is at the end of the constructor. Thanks, Gil. ...

Nested Threads?

What are the rules regarding spawning new threads within other running threads? I have a C# app that handles two basic threads in the background. I recently introduced some heavy duty IO stuff, and I was thinking of setting them off inside threads. Are threads nested within themselves cool? ...

Multithreading: apache portable runtime vs boost::thread?

Which way is better for a novice student who has never used boost? When a new standard arrives, the answer will be obvious, but now I have doubts. Pro for boost is that it's much closer to future standard. ...

STA threads with SQLXMLBULKLOAD

If I have N STA .NET Threads each performing an independent bulk load operation on a different database using the SQLXMLBulkLoad dll (which requires calling threads to be STA), is it possible for all bulk loads to be happening at the same time, or are they implicitly serialized due to the STA COM configuration? Thanks! ...