LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 08-05-2009, 02:18 PM   #1
zvivered
Member
 
Registered: Sep 2007
Posts: 294

Rep: Reputation: 23
SMP for Embedded linux


We want to run a vanilla version on a Core2Duo x86 CPU.
Our application is one process with many threads. We want to
tell linux on which CPU to run a specified thread. The reason is determinism.

If we let Linux decide this it can lead to an undeterministic system. This is OK in desktop applications, not in my embedded system.

Is "manual" SMP in linux a mature capability ? Is it wise to use it on
a "soft" real time system ?

Thanks.
 
Old 08-05-2009, 02:28 PM   #2
vermaden
Member
 
Registered: Jan 2006
Location: pl_PL.lodz
Distribution: FreeBSD
Posts: 406

Rep: Reputation: 89
We have used it on routers/servers without any problems.
 
Old 08-06-2009, 06:22 AM   #3
jf.argentino
Member
 
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493

Rep: Reputation: 50
You can assign a thread to on CPU only with:
Code:
   cpu_set_t cpuset;
   CPU_ZERO (&cpuset);
   CPU_SET (cpu_id, &cpuset);
   sched_setaffinity (syscall (SYS_gettid), sizeof (cpu_set_t), &cpuset);
Where "cpu_id" is between 0 and the nb of cpu you have less 1.
_BUT_ assigning a thread to a given CPU doesn't mean that any other process can run on this CPU, thus it won't be more deterministic. If you really need determinism you have to use something like xenomai...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Xpert in 8-16 bit microcontroller embedded system now inclining toward embedded linux priyadarshan Linux - Embedded & Single-board computer 2 02-12-2009 04:28 AM
pthread_mutex_lock/unlock SMP and CPU cache coherence on core2 SMP sergxm Linux - Kernel 0 01-27-2009 04:32 PM
LXer: Embedded Linux as Dependable for Developers as RTOSes, says Embedded Market For LXer Syndicated Linux News 0 01-23-2008 11:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 03:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration