We'd like to remind Forumites to please avoid political debate on the Forum... Read More »
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

chunter
Posts: 2,015 Forumite


in Techie Stuff
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...
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...
0
Comments
-
See here
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=103001
here
https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=104705
and here
https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=102895
and finally here:
https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=100653Science isn't exact, it's only confidence within limits.0 -
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.)0 -
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...0 -
0
This discussion has been closed.
Confirm your email address to Create Threads and Reply

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