What is a task?

  • In 'NSNotificationCenter Class Reference' it says:

    Each task has a default notification center.

    I wonder what a task is?

    In
    'Multithreading Programming Topics' it says:

    In Mac OS X, each process (application) is made up of one or more threads. ...Threads let your program perform multiple tasks in parallel.... Each
    thread has its own execution stack and is scheduled for runtime
    separately by the kernel.

    From the above description it is clear what a thread is. But what is a task? Can a thread have several tasks with each task having its own default notification center?

    Bob

    __________________________________________________
    Do You Yahoo!?
    Tired of spam?  Yahoo! Mail has the best spam protection around
    http://mail.yahoo.com
  • Hi Bob,

    The terminology has gotten a little confusing between those two
    examples.

    The notification center reference should say (IMHO) thread, not task.
    Please raise a radar bug on this at bugreport.apple.com as the page
    contains both thread and task and definitely confuses them.

    The terms thread and task are sometimes used interchangeably and mean
    the same thing. But sometimes they do mean different things.
    This has been a confusing issue for a long time so I doubt that it
    will ever be properly resolved other than by conventions within
    individual groups of developers or in particular workplaces.

    Personally I think of a thread as an executable that I can ask to do
    different tasks for me, where a task is a job that I need done.

    Hope that helps,

    Wain

    On 20 Oct 2007, at 14:23, Bob Ueland wrote:

    > In 'NSNotificationCenter Class Reference' it says:
    >
    > Each task has a default notification center.
    >
    > I wonder what a task is?
    >
    > In
    > 'Multithreading Programming Topics' it says:
    >
    >
    > In Mac OS X, each process (application) is made up of one or more
    > threads. ...Threads let your program perform multiple tasks in
    > parallel.... Each
    > thread has its own execution stack and is scheduled for runtime
    > separately by the kernel.
    >
    >
    > From the above description it is clear what a thread is. But what
    > is a task? Can a thread have several tasks with each task having
    > its own default notification center?
    >
    > Bob
    >
  • On 20 Oct 2007, at 14:23, Bob Ueland wrote:

    > In 'NSNotificationCenter Class Reference' it says:
    >
    > Each task has a default notification center.
    >
    > I wonder what a task is?

    The meaning of the word "task" depends on the context.  Often (as in
    this instance), it means the same thing as "process".

    > In 'Multithreading Programming Topics' it says:
    >
    > In Mac OS X, each process (application) is made up of one or more
    > threads. ...Threads let your program perform multiple tasks in
    > parallel.... Each
    > thread has its own execution stack and is scheduled for runtime
    > separately by the kernel.

    In this instance, "task" is being used as a generic term for some
    unit of work (the word "job" is also commonly used for this, though
    historically that might also have been confusing).  It isn't the same
    meaning.

    > From the above description it is clear what a thread is. But what
    > is a task? Can a thread have several tasks with each task having
    > its own default notification center?

    No.  The process (the first meaning of "task") has a default
    notification centre.  Threads share that notification centre, though
    it's important to note that notifications will be delivered on the
    thread that sent them.

    Kind regards,

    Alastair.

    --
    http://alastairs-place.net
  • On 20 Oct 2007, at 15:11, Wain Glaister wrote:

    > The notification center reference should say (IMHO) thread, not task.

    I don't think that's correct.  The default notification centre is per-
    process, not per-thread, I believe.

    > Personally I think of a thread as an executable that I can ask to
    > do different tasks for me, where a task is a job that I need done.

    That's even more confusing than the original!  And you've thrown the
    meaning of executable into question as well, as well as using the
    word "job" (which is also ambiguous).

    A thread is a separate flow of control, usually with some per-thread
    state.  A process is a collection of threads and some per-process
    state.  An executable is a binary image of a program, often held on
    disk (e.g. "/bin/ls" is an executable).

    The word "task" is sometimes used to mean "process" (in the computing
    sense).  It is also often used in the normal English sense of the
    word (i.e. some work to be done).  Which meaning you ascribe to a
    particular occurrence of the word depends on the context.

    Kind regards,

    Alastair.

    --
    http://alastairs-place.net
previous month october 2007 next month
MTWTFSS
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Go to today