As I increasingly dabble with AppleScript and OS X tweaking in general, I arrive at this question:

What is the difference between these two words in terms of OS X's inner operations - e.g. do some processes operate 'within' applications (or vica versa), or two processes operate as part of one 'application' in terms of what the user interacts with GUI-wise (or, vica versa)?

Also - I come originally from a Microsoft Windows background. Do 'application' and 'process' have any relationship to 'service' in OS X, (given 'service' and 'program' are different things in Windows), and is there indeed a third category in OS X called 'service' as well?

4 Answers
4

The standard way of approaching these terms is to say that an "application" is a specific, static program on storage. It's some piece of code stored on a hard drive, a CD-ROM or elsewhere.

A "process" on the other hand is a specific instance of a running program. I.e. it is registered by the operating system as executing or being able to execute whenever the operating system feels like it.

If you take for example Calculator.app, it is a single application.
However you can have multiple Calculator processes if you start the program multiple times.

As chananelb wrote, it is also possible to have processes which are not "just" ordinary applications that have been started up. That could be for example kernel processes, or simply ordinary processes spawning up subprocesses to do specific tasks.

Regarding services, I chananelb's answer leads you in the wrong direction. His answer tells you about what is called a "Service" in Mac OS X... but you asked about what is called a "Service" in Windows.

The counterpart to a Windows Service is a Daemon on Mac OS X (and other Unix-derived systems).

Daemons are normally categorized by running in the "background", i.e. without direct user interaction through a graphical or non-graphical user interface. The distinction is a bit blurry though, as a Daemon might for example have a web interface for user interaction.

Daemons on Mac OS X are controlled by the launchd program, which is responsible for for example starting up daemons on boot, and letting the user start and stop daemons at request.

Application bundles are one of the most common types of bundle created by developers. The application bundle stores everything that the application requires for successful operation.

On the same page, it says:

Note: Although bundles are one way of packaging executable code, they are not the only way that is supported. UNIX shell scripts and command-line tools do not use the bundle structure, neither do static and dynamic shared libraries.

Based on that, I would say that Apple does not consider command-line tools such as ls to be "applications". They would be executable programs or executables.

A process is any instance of a computer program that is being executed. A process could be created by running either an application or a Unix executable. (Shell scripts would be a kind of executable where /bin/sh or another shell interprets the script.)

"Process" means the same thing in Windows (see the Process tab in the Windows Task Manager).

Service has three different meanings in Mac OS X:

It could refer to a daemon, which is analogous to a Windows Service. These are persistent system-wide background processes that do not belong to any user's session.

It can also be used in the generic English sense of the word, as in Launch Services. Launch Services is an API to open applications, and can, for example, decide which is the appropriate application to handle a particular kind of file.

An application is a process that can spawn sub-processes (known as children) but some processes are spawned by the OS itself and may not have an 'application' per se behind them. This is (to my understanding) the way unix works in general (unix intro - processes).

Thanks jksoegaard, the following is irrelevant, I misread the question. I'm sort of new - do I delete it or leave it?

Services in OS X are somewhat similar to the share button in android - its a way for you to send a chunk of data directly from the current app to a different one.

An easy example is text - highlighting some text and right-clicking will show you the context menu with services at the bottom, drilling into that menu will show you which other apps on you mac have the ability to use that text for something (e.g. summarize, search web (Chrome), Spotlight, etc).

You can modify services in the Keyboard Preference pane under the 'Shortcuts' tab and create your own in Automator see this Ars Technica article for more info.

Application: a computer program that performs useful work not related to the computer itself; a piece of software that performs a particular function for the user. Examples include word processing programs, web browsers, presentation programs, and accounting systems.

Process: a series of instructions that a computer is executing in a multitasking operating system. Many processes execute concurrently. From the user's viewpoint, processes may be programs or parts of programs (such as the editing routine and the printing routine in a word processor that can print while editing).

Note that the two aren't necessarily mutually exclusive.Simply put, though, an application is a bundled set of processes, which, to the user, appear as one.

These are not the terms uses in OSX - OSX has much more specific definitions which are what the OP needs to know
–
MarkMay 18 '14 at 12:29

General, yes. Applicable to OSX? Completely. The question itself is broad enough for these definitions to be perfectly applicable. A process is a process, and an application is an application, as defined above, regardless of whether you're running Windows or OSX. OSX specific terms 'launchagents, launchdaemons, etc' aren't necessary to answer the question; moreover, they may be misleading. My answer is clear and straightforward. Regards.
–
njbootMay 18 '14 at 12:35

1

For Applescript there is a very strict definition of Application - and in OSX I would only call Packaged application bundles as Applications (I can't find all the exact Apple reference documents at the moment so can't write an answer yet)
–
MarkMay 18 '14 at 12:38