Thread: Automatic multi cores

  1. #1
    Registered User
    Join Date
    Apr 2017
    Location
    Iran
    Posts
    138

    Automatic multi cores

    Hi,

    I am wondering what may happen if such is used to multi core coding:

    Code:
    #include <multi_core.h>
    
    int main(void)
    {
        ...
        use_n_cores(MAX_CORES);
        ...
        
        return EXIT_SUCCESS;
    }

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    You need to be more specific about which API you're using.

    An API might balance what you ask for, with what is actually available on any given machine.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Apr 2017
    Location
    Iran
    Posts
    138
    Quote Originally Posted by Salem View Post
    You need to be more specific about which API you're using.

    An API might balance what you ask for, with what is actually available on any given machine.
    I mean, can this method be a replacement of using <stdatomic.h> ?

    By the way please explain more on your mentioned API.

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    What do you mean "my API"?

    You're the one who plucked 'use_n_cores' out of the void without any reference to what it does.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Access a FIFO(Circular Queue) between two cores
    By santy in forum C Programming
    Replies: 8
    Last Post: 11-03-2014, 08:19 AM
  2. getting number of cores using glibc?
    By ppdouble in forum C Programming
    Replies: 0
    Last Post: 06-02-2012, 10:19 PM
  3. Graphic Card Cores
    By manasij7479 in forum Tech Board
    Replies: 2
    Last Post: 08-26-2011, 10:19 PM
  4. Replies: 13
    Last Post: 05-22-2009, 10:37 AM
  5. finding number of cores in a multi-core processor
    By doubleanti in forum Tech Board
    Replies: 3
    Last Post: 03-05-2008, 03:36 PM

Tags for this Thread