Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I want to say that my program is capable of splitting some work across multiple CPU cores on a single system. What is the simple term for this? It's not multi-threaded, because that doesn't automatically imply that the threads run in parallel. It's not multi-process, because multiprocessing seems to be a property of a computer system, not a program. "capable of parallel operation" seems too wordy, and with all the confusion of terminology, I'm not even sure if it's accurate.

So is there a simple term for this?

Edit: The parallelization framework used by my program implements parallelism by forking multiple processes and communicating between them.

Edit 2: I found the following in Wikipedia's article on Concurrency: "Concurrent programming is usually considered to be more general than parallel programming ..." Based on this, both "concurrent" and "parallel" are apt descriptions of my program, with "parallel" being the more precise one.

However, I realize that Wikipedia, like any encyclopedia, is appropriate for getting an overview of a subject, but may not be the best source for resolving such subtleties. So I would appreciate it if someone could cite a more authoritative source demonstrating the difference between these two, or whether there really is a difference.

share|improve this question
add comment

6 Answers

There are two different but related things here:

  • If your program runs a single thread, fiber sub-process or any other other instruction sequencing mechanism, then it is single-threaded, regardless of whether it runs it always on the same core (affinity) or it cycles through different cores. If, to the contrary, your program runs multiple threads, fibers sub-processes, etc., then it is multi-threaded, again regardless of whether it does it on the same core or on different ones.

  • If your program is multi-threaded, and only in that case, it may run multiple threads, fibers, sub-processes, etc. simultaneouosly. In this case, it is called a parallel program.

Notice that a parallel program is always multi-threaded, but you can have multi-threaded programs that are not parallel.

share|improve this answer
    
It is normal for programs running on top of an operating system to allow the OS to manage the allocation of threads to processor cores. So if the program is not running on an OS, you can probably say it is concurrent. If it runs on an OS then its really just multi-threaded and the OS allocates threads to cores to try and meet performance criteria. (It was a hugely big deal back in the early 1990's when operating systems could actually do this, and The Latest Big Thing was an OS that supported Symmetric Multiprocessing. Wheee!!!) –  quickly_now Jul 1 '11 at 1:17
    
@quickly_now: Yes, I know that. I was trying to make some systematic definitions. –  CesarGon Jul 1 '11 at 1:33
1  
A program using parallel execution need not be multi-threaded, it could instead use multiple processes. Consider the fork command. –  edA-qa mort-ora-y Jul 1 '11 at 8:07
1  
@edA-qa mort-ora-y: In computing, "process" is usually defined as "an instance of a program that is being executed". If we agree on this, then multiple processes could never be part of the same running program; each one corresponds to a separate running program, regardless of whether they have been forked from one another or not. Of course, you may not agree with the definition of process, but that's deviating too much from the general consensus in computer science; see en.wikipedia.org/wiki/Process_(computing) –  CesarGon Jul 2 '11 at 13:43
1  
@edA-qa mort-ora-y: Your program is multi-threaded. Each process contains at least one thread, so multiple processes => multiple threads. –  CesarGon Jul 2 '11 at 15:35
show 5 more comments

I think it's a little difficult to answer this without more information. How exactly is work to be split across the cores?

Anyway, there are two main distinctions I would make:

  • Concurrent Programs. Here, different threads of control are operating concurrently to achieve different tasks. Each thread may be at a different position in the program at any given moment. A good example of this would be a web server which spawns threads to process requests. Deadlocks and fairness of scheduling are major concerns here.

  • Parallel Programs. These are performing parallel operations over some (large) dataset. Whilst this may actually be implemented using multiple threads, this is not necessarily the case. In particular, it may be implemented directly by exploiting special parallel CPU instructions (think MMX/SSE extensions and the like, or GPU programming). Map/Reduce style programming is a natural fit in this category. Scala's parallel for loop is another good example of this.

This distinction is often referred to as task parallelism versus data parallelism.

share|improve this answer
    
My program does data parallelism. –  Ryan Thompson Jul 2 '11 at 14:03
    
those distinctions are irrelevant to the concern of concurrency –  Jarrod Roberson Jul 2 '11 at 15:27
    
Wikipedia implies that concurrency is a more general term that includes parallelism, rather than them being distinct. –  Ryan Thompson Aug 7 '11 at 17:16
add comment

Concurrent

In computer science, concurrency is a property of systems in which several computations are executing simultaneously, and potentially interacting with each other. The computations may be executing on multiple cores in the same chip, preemptively time-shared threads on the same processor, or executed on physically separated processors. A number of mathematical models have been developed for general concurrent computation including Petri nets, process calculi, the Parallel Random Access Machine model and the Actor model

.

share|improve this answer
    
an answer that is nothing but a single word with a link to another site is not a good answer, even if the content at the other end of the link is fantastic. meta.stackexchange.com/questions/94022/… has some highly upvoted suggestions for writing answers that contain links. –  Kate Gregory Jul 2 '11 at 15:08
add comment

You can the term "concurrent/parallel program". The two terms are slightly different in that parallelism implies having more than one physical cpu core whereas concurrency involves more than one thread irrespective of number of cores.

share|improve this answer
    
there is no distinction between these terms –  Jarrod Roberson Jul 2 '11 at 15:26
    
Wikipedia seems to imply that there is a distinction. Specifically, in the Concurrency article, "Concurrent programming is ... more general than parallel programming because it can involve arbitrary and dynamic patterns of communication and interaction, whereas parallel systems generally have a predefined and well-structured communications pattern." Based on that description, I believe that "parallel" appropriately describes my program, and "concurrent" is a more general but still correct description. –  Ryan Thompson Aug 7 '11 at 17:12
    
@Ryan concurrent is a synonym for parallel as the definition of both is simultaneous. There is no distinction that parallel implies physical CPU vs Multiple Cores on a single CPU as this answer states. Matter of fact this answer is backwards and completely incorrect. Because concurrent means simultaneous, and this answer refers to multiple threads which implies there may only be one thread executing at a time, which would be serial and not concurrent at all. –  Jarrod Roberson Aug 11 '11 at 17:02
add comment

Multi-core aware

Everyone else's answer so far seems to have a caveat about what it describes. Why not get right to the heart of the matter?

share|improve this answer
1  
A program that sets its CPU affinity is certainly multi-core aware, even if that program is single-threaded. And yes, some programs do this for efficiency reasons. –  edA-qa mort-ora-y Jul 1 '11 at 8:09
2  
"Aware" does not take more than printing out the environment variables saying the computer has X cores. –  user1249 Jul 1 '11 at 8:22
add comment

Perhaps you could say your program is Asynchronous, or that it performs its work Asynchronously. Not quite sure for your particular program/method.

share|improve this answer
    
Asynchronous means that the program does not wait for a call to complete after it's made and keeps running; it doesn't relate to the way in which work is distributed across cores. –  CesarGon Jul 1 '11 at 0:41
    
asynchronous has no bearing on concurrency –  Jarrod Roberson Jul 2 '11 at 15:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.