C11 (latest c standard) supports threading, any mention about scheduling

Discussion in 'C Programming' started by Varun Tewari, Apr 1, 2013.

  1. Varun Tewari

    Varun Tewari Guest

    People,

    probably everyone here knows C now officially supports threading.
    I want to know does it also mention anything about scheduling it on different cores?

    I mean, does C today claim to be language for multi-core programming which (ensures or tries to) schedule code (threads) on different cores like other multi-core languages like "go" etc.


    Thnx.
     
    Varun Tewari, Apr 1, 2013
    #1
    1. Advertising

  2. Varun Tewari

    James Kuyper Guest

    Re: C11 (latest c standard) supports threading, any mention aboutscheduling

    On 04/01/2013 01:36 PM, Varun Tewari wrote:
    > People,
    >
    > probably everyone here knows C now officially supports threading.
    > I want to know does it also mention anything about scheduling it on different cores?
    >
    > I mean, does C today claim to be language for multi-core programming which (ensures or tries to) schedule code (threads) on different cores like other multi-core languages like "go" etc.


    C claims to be a language that can be used to for multi-threaded
    programming. However, it leaves the details of how threads are
    implemented up to the individual implementation of C, only the interface
    and the required behavior is defined, and the required behavior is
    defined in terms of threads, not cores.

    On a system with multiple cores, assigning threads to particular cores
    might be a reasonable thing to do, but the standard says nothing about
    cores, single or multi. Nor does it require that implementations be
    reasonable - that's purely a matter of Quality of Implementation (QoI),
    and therefore outside the scope of the standard.

    Do you have any portable need to know, for certain, whether there's a
    connection between threads and cores?
     
    James Kuyper, Apr 1, 2013
    #2
    1. Advertising

  3. Varun Tewari

    Eric Sosman Guest

    Re: C11 (latest c standard) supports threading, any mention aboutscheduling

    On 4/1/2013 1:36 PM, Varun Tewari wrote:
    > People,
    >
    > probably everyone here knows C now officially supports threading.
    > I want to know does it also mention anything about scheduling it on different cores?


    The one and only appearance of the word "scheduling" in the C
    Standard is in section 7.26.5.7p3, describing the thrd_sleep() function:

    "The suspension time may be longer than requested because the
    interval is rounded up to an integer multiple of the sleep
    resolution or because of the scheduling of other activity
    by the system."

    Draw your own conclusions.

    > I mean, does C today claim to be language for multi-core programming which (ensures or tries to) schedule code (threads) on different cores like other multi-core languages like "go" etc.


    The word "core" appears exactly zero times in the Standard.
    Draw your own conclusions.

    --
    Eric Sosman
    d
     
    Eric Sosman, Apr 1, 2013
    #3
  4. Varun Tewari <> writes:
    > probably everyone here knows C now officially supports threading. I
    > want to know does it also mention anything about scheduling it on
    > different cores?
    >
    > I mean, does C today claim to be language for multi-core programming
    > which (ensures or tries to) schedule code (threads) on different cores
    > like other multi-core languages like "go" etc.


    A recent draft of the C11 standard is available at:

    http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf

    Its content is *almost* identical to the official standard (I know of
    only one difference, which was discussed recently in comp.std.c).

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Working, but not speaking, for JetHead Development, Inc.
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
     
    Keith Thompson, Apr 1, 2013
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steven Woody
    Replies:
    0
    Views:
    421
    Steven Woody
    Jan 9, 2009
  2. Keith Thompson

    Reasonably priced C11 standard?

    Keith Thompson, Jan 25, 2012, in forum: C Programming
    Replies:
    85
    Views:
    2,558
    Deirdre
    Apr 6, 2012
  3. Lord Voldermort
    Replies:
    20
    Views:
    849
    David Thompson
    Mar 1, 2012
  4. Dann Corbit
    Replies:
    7
    Views:
    976
    Jorgen Grahn
    Jul 13, 2012
  5. Replies:
    2
    Views:
    410
    Ben Bacarisse
    Aug 5, 2012
Loading...

Share This Page