multicore

Followup: Multiprocessing or Multithreading for Python simulation software

Hello folks, this is a follow up to this. (You don't have to read all the answers, just the question) People explained to me the difference between processes and threads. On the one hand, I wanted processes so I could fully exploit all core of the CPU, on the other hand, passing information between processes was less than ideal, and I d...

How does sched_setaffinity() work?

I am trying to understand how the linux syscall sched_setaffinity() works. This is a follow-on from my question here. I have this guide, which explains how to use the syscall and has a pretty neat (working!) example. So I downloaded the Linux 2.6.27.19 kernel sources. I did a 'grep' for lines containing that syscall, and I got 91 res...

How good is the JVM at parallel processing? When should I create my own Threads and Runnables? Why might threads interfere?

I have a Java program that runs many small simulations. It runs a genetic algorithm, where each fitness function is a simulation using parameters on each chromosome. Each one takes maybe 10 or so seconds if run by itself, and I want to run a pretty big population size (say 100?). I can't start the next round of simulations until the prev...

How to perform atomic 64b read on x86 (Pentium and above)?

I would like to perform and atomic read of 64b aligned 64b data on x86 platform (Pentium or above guaranteed). Is there a way to do this? (And no, I do not want to use a critical section or a mutex for this, I want this to be lock-free). ...

Assembly instructions to find how many threads are enabled in a multi-core system

I'm working on a bare-bones system in which I need to determine sometime after boot how many cores and threads are enabled, so that I can send them SIPI events. I also want each thread to know which thread it is. For instance, in a single-core configuration with HT enabled, we have (for instance, Intel Atom): thread 0 --> core 0 threa...

Enable multiproc in Msbuild via API

With Msbuild v3.5 I can include the "/m" switch to enable multiprocessor support . However I cannot find an equivalent property that hangs off of anything in Microsoft.Build.BuildEngine. How do I enable this setting via the API? I tried to discover this myself by reflecting over Msbuild.exe (thanks Lutz!) but it doesn't use the BuildEn...

What's the opposite of "embarrassingly parallel"?

According to Wikipedia, an "embarrassingly parallel" problem is one for which little or no effort is required to separate the problem into a number of parallel tasks. Raytracing is often cited as an example because each ray can, in principle, be processed in parallel. Obviously, some problems are much harder to parallelize. Some may eve...

Using multi-threading to speed up .NET reflection

My PC have a dual core CPU and I was wondering - would it be possible to reduce .NET reflection times by two, if I start processing in a two thread. By "processing" I have meant the following: 1.loading the assembly 2.getting all types out of it (.GetTypes()) 3.processing these types 4.querying these types for methods etc. If yes - w...

Synchronous vs asynchronous programming

When designing a server, we are considering two approaches: A asynchronous (select based) approach so the backend rpc can be parallelized in a single thread. A synchronous approach where each backend rpc is processed in another thread from the thread pool. There are trade offs: 1 has better performance and 2 has less code complexity...

Any multi-core advantage here ?

Let me frame it this way.. "Say I have an application server running on a single core Intel processor & serving 200 concurrent users. Will moving the hardware to a dual core system enable my application server to now serve say 350 concurrent users" ? The base question I'm hoping to address is - "Can addition of extra processor cores h...

Multiproc builds in VS2008

I remember reading somewhere about multiproc builds in VS2008, only I can't find the article now. Does anyone know how to turn this on, or even if it is possible? ...

Writing functional programs in non-functional languages

Suppose I write a program using immutable data structures in Java. Even though it is not a functional language, it should be able to execute parallely. How do I ensure that my program is being executed using all the cores of my processer? How does the computer decide which code can be run parallely? P.S. My intent in asking this questi...

Why would one CPU core run slower than the others?

I was benchmarking a large scientific application, and found it would sometimes run 10% slower given the same inputs. After much searching, I found the the slowdown only occurred when it was running on core #2 of my quad core CPU (specifically, an Intel Q6600 running at 2.4 GHz). The application is a single-threaded and spends most of ...

concurrent variable access in c

I have a fairly specific question about concurrent programming in C. I have done a fair bit of research on this but have seen several conflicting answers, so I'm hoping for some clarification. I have a program that's something like the following (sorry for the longish code block): typedef struct { pthread_mutex_t mutex; /* some sh...

can i easily write a program to make use of Intel's Quad core or i7 chip if only 1 thread is used?

I wonder if in my program I have only 1 thread, can I write it so that the Quad core or i7 can actually make use of the different cores? Usually when i write programs on a Quad core computer, the CPU usage will only go to about 25%, and the work seems to be divided among the 4 cores, as the Task Manager shows. (the programs i wrote usu...

Can DCOM/ COM+ activated objects deadlock CPU?

How does one figure out CPU level deadlocks for a COM+ application? This is an application running on Win2K. Regardless of the load, 1 object which is used by all other objects starts building up call times suddenly and then the system crashes. The only way to restore the system to its normal working situation is by restarting the COM+ a...

Developing Kernels to support Multiple CPUs

I am looking to get into operating system kernel development and figured my contribution would be to extend the SANOS operating system in order to support multiple core machines. I have been reading books on operating systems (Tannenbaum) as well as studying how BSD and Linux have tackled this challenge but still am stuck on several conc...

Which apps are too slow? or: Is multi-core needed?

Just like cars, speed is cool, but: "is speed needed? Will people to pay for it?" Word processing, email and spreadsheets are fast enough, even on underpowered netbooks (they've been fast enough for a decade.) Provided you can play HD video and sound, do people need it to be faster? It seems that games can always use more power, and i...

Advantage of setting threads to work on a particular core?

Hi, Is there any evidence to suggest that by manually picking which processor to run a thread on you can improve system performance? For example say you dedicated the thread that does the most work to one core and all other "helper" threads to a second. ...

Programming on future hardware?

I want to practice programming code for future hardware. What are these? The two main things that come to mind is 64bits and multicore. I also note that cache is important along and GPU have their own tech but right now i am not interested in any graphics programming. What else should i know about? -edit- i know a lot of these are in ...