multithreading

Physical location aware user space memory allocation in Linux (memory controller affinity)

I want to test the performance variations that may happen if memory is allocated and accessed from different physical CPUs and from different embedded memory controllers for a 64 bit, 2 CPU, 16 core Intel Xeon 5500 CPU based server. (Dell T710) Looking at the vendor white paper i can see each physical CPU has 3 independent memory contro...

thread livelock doubt

On site http://download-llnw.oracle.com/javase/tutorial/essential/concurrency/starvelive.html there is a concept of livelock where first is said that here the threads are not blocked and after is said that thread are blocked... "They're still blocking each other" so I don't understand well... if they are blocked it seems like deadlock......

GCC std::thread problem

I am using GCC 4.5.0 with the Eclipse IDE (if that matters) on Windows via MinGW. I'm using the -std=c++0x flag. I find that _GLIBCXX_HAS_GTHREADS still isn't defined, so thread for me still isn't a member of namespace std. -- or perhaps it is something else. What does one do to get C++0x threading support with GCC? P.S. It doesn't r...

General: callback provided by API, deletion procedure

Hi there, I have a general interest in the following question and would like to hear your opinion. Setting: Imagine an API that provides a Callback-Interface Cb, that is you can create a Cb object and register it on the API. The API will call methods of your object in some other thread. This could be the case where you want to receive...

Creating Threads in C#

Hello, I am trying to get a thread working in C# to reset the time and run another function alongside it. The code I have is: Thread loopTime = new Thread(this.someFunction); loopTime.Start(); for (int i = 0; i < 20; i++) { ChangeTimeFunction(someTime); Thread.Sleep(200); } I am getting a threading error if I pass in this.So...

Is there a point to multithreading?

I don’t want to make this subjective... If I/O and other input/output related bottlenecks are not of concern then do we need to write multithreaded code? Theoretically the single threaded code will fare better since it will get all the CPU cycles. Right? Would JavaScript of ActionScript have fared any better, had they been multith...

Issues with time.sleep and Multithreading in Python

I am having an issue with the time.sleep() function in python. I am running a script that needs to wait for another program to generate txt files. Although, this is a terribly old machine, so when I sleep the python script, I run into issues with the other program not generating files. Is there any alternatives to using time.sleep()? I t...

Message Queue VS Thread Pool

Hello to all, i wonder what the difference between these two ? Thanks. ...

C# Threading in real-world apps.

Learning about threading is fascinating no doubt and there are some really good resources to do that. But, my question is threading applied explicitly either as part of design or development in real-world applications. I have worked on some extensively used and well-architected .NET apps in C# but found no trace of explicit usage.Is th...

C# Thread Parameters change during thread execution - why?

So I have a method that gets a Dictionary of List<myObj>, then cycles through the keys of the dictionary and passes each List<myObj> to a separate thread. Here is some Code / Psuedo-Code: public static void ProcessEntries() { Dictionary<string, List<myObj>> myDictionary = GetDictionary(); foreach(string key in myDictionary.ke...

How to step through Python threads independently? (WinPDB)

Hello, I am trying to debug Python using WinPDB and I have multiple threads using threading.Thread. I can never seem to control the threads individually. If I break execution, the entire script breaks. If I step through the source code of one thread, all of the others continue to be interleaved and continue some of their execution. ...

Maximizing Worker Thread Utilization

To solve a problem (and better my understanding of multitasking) I have written a small thread pool implementation. This thread pool spins up a number of worker threads which pop tasks off of a queue as they are added by the client of the thread pool. For the purposes of this question when the task queue is empty the worker threads are a...

OpenSSL and multi-threads

I've been reading about the requirement that if OpenSSL is used in a multi-threaded application, you have to register a thread identification function (and also a mutex creation function) with OpenSSL. On Linux, according to the example provided by OpenSSL, a thread is normally identified by registering a function like this: static uns...

Can parallel operations speed the availability of a file from a hard disk in R?

I have a huge datafile (~4GB) that I am passing through R (to do some string clean up) on its way into an MySQL database. Each row/line is independent from the other. Is there any speed advantage to be had by using parallel operations to finish this process? That is, could one thread start with by skipping no lines and scan every seco...

Efficient Cancel Event Implementation for Number Crunching Threads

What is the most efficient way to create a “cancel” event in a C# program that is crunching a large set of data in a loop on a separate thread? For now, I am simply using a cancel event that is triggered from my UI thread, which subsequently calls an “onCancel” function on the number crunching thread. That cancel function sets a variable...

Buffer underrun logic problem, threading tutorial?

Ok, I tried all sorts of titles and they all failed (so if someone come up with a better title, feel free to edit it :P) I have the following problem: I am using a API to access hardware, that I don't coded, to add libraries to that API I need to inherit from the API interface, and the API do everything. I put in that API, a music gene...

VB.NET - Set external process priority to Low / Pause external process (while running)

Developing a UI for an image compactor, and I have built a Pause/Resume button. I need it to pause/set priority to low while it is running. Now I know that it is dangerous to Pause a process and has to do with threading, but if someone knows how to do this, please help! Also, if the above cannot be done efficiently enough, I would ra...

How to get access to Window from another thread?

var t = new Thread(new ParameterizedThreadStart(DoWork)); t.SetApartmentState(ApartmentState.STA); t.IsBackground = true; t.Start(App.Current.MainWindow); public static void DoWork(object owner) { var progressDlg = new ProgressBarDialog(); // progressDlg.Owner = (Window)owner; // This doesn't wor...

Threads and the new Task library in C#

I came across this comprehensive explanation of the new .NET TPL library recently, and it sounded pretty impressive. Having read the article, it appears that the new taskmanager is so clever it can even tell whether your parallel tasks would be faster if done serially on the same thread, rather than be parcelled out to worker threads. Th...

pthread_create ENOMEM around 32000 threads

The process running get stuck around 32 000 (± 5%) ~# cat /proc/sys/kernel/threads-max 127862 ~# ulimit -s stack size (kbytes, -s) 2048 free memory available : 3,5 Go Further more when I try basic command while the process is stuck like "top", I get the bash message : can't fork, not enough memory. Even if there is stil...