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

V

Varun Tewari

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.
 
J

James Kuyper

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?
 
E

Eric Sosman

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.
 
K

Keith Thompson

Varun Tewari said:
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).
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top