Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C Programming (http://www.velocityreviews.com/forums/f42-c-programming.html)
-   -   C11 (latest c standard) supports threading, any mention about scheduling (http://www.velocityreviews.com/forums/t959268-c11-latest-c-standard-supports-threading-any-mention-about-scheduling.html)

Varun Tewari 04-01-2013 05:36 PM

C11 (latest c standard) supports threading, any mention about scheduling
 
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.

James Kuyper 04-01-2013 05:58 PM

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?


Eric Sosman 04-01-2013 05:58 PM

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
esosman@comcast-dot-net.invalid

Keith Thompson 04-01-2013 06:31 PM

Re: C11 (latest c standard) supports threading, any mention about scheduling
 
Varun Tewari <tewari.varun@gmail.com> 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/wg...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) kst-u@mib.org <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"


All times are GMT. The time now is 02:45 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.