We're aware that some users are experiencing technical issues which the team are working to resolve. See the Community Noticeboard for more info. Thank you for your patience.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

Raspberry Pi 2 - can you program individual cores?

Options
Can you program the individual cores?
http://www.amazon.co.uk/gp/product/B00T2U7R7I?!!!!!hotukdealsev-21
Raspberry Pi 2 Model B Desktop (Quad Core CPU).

I was just wondering if it's possible?
and is there a language that'll let me do it?

I used to do a bit of parallel programming and wouldn't mind trying out a few unfinished algorithms...

Comments

  • psychic_teabag
    psychic_teabag Posts: 2,865 Forumite
    Part of the Furniture 1,000 Posts Name Dropper Combo Breaker
    edited 16 December 2015 at 7:09PM
    Generally, linux will automatically schedule threads (and processes) to the cores as they are available. So any mutli-threaded program would automatically use the cores. And I think it has algorithms to try to avoid gratitously moving threads between cores, to benefit cache, but I'm not so sure about that bit.

    if you want to take more control, threads have a "cpu affinity", and so you can force a thread (or process) to run on only a particular core (or more generally, set of cores).

    You do have to take care about making sure each thread can see updates to shared memory - the standard locks will include memory barriers, but if you are taking lower-level control, you'd have to put in your own explicit memory barriers.

    If you want to go lower-level than linux, then I'm afraid you're on your own. Not sure what riscos does with the threads. There may be embedded / realtime OS-s you can run.


    I believe 'erlang' is a language that's very good for expressing concurrency. I've never got round to trying it out myself.

    ETA: I think the 'go' language also has concurrency support. (And there's java of course, but that limits any kind of low-level control over execution.)
  • forgotmyname
    forgotmyname Posts: 32,918 Forumite
    Part of the Furniture 10,000 Posts Name Dropper
    Playing with a couple at the moment and quite amazed how much power they pack into that small package.

    The sound sucks though. currently running the sound through the HDMI. Will try the audio out option and see if thats any better.

    I did notice a random bussing noise on one PC with a slightly lower USB voltage.
    Censorship Reigns Supreme in Troll City...

  • "The sound sucks though."

    https://www.hifiberry.com
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 350.9K Banking & Borrowing
  • 253.1K Reduce Debt & Boost Income
  • 453.5K Spending & Discounts
  • 243.9K Work, Benefits & Business
  • 598.7K Mortgages, Homes & Bills
  • 176.9K Life & Family
  • 257.1K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16.1K Discuss & Feedback
  • 37.6K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.