LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-07-2016, 07:07 AM   #1
lukecam1995
LQ Newbie
 
Registered: Oct 2016
Posts: 6

Rep: Reputation: Disabled
Is it possible to implement POSIX threads on a Marvell PXA270 processor?


Hi I would like to have one of my robots as a server. However I would need the server processing to run in the background while all the other processing is going on. Hence I was going to use pThreads but I don't know if that is possible on a single core chip.

Thanks!
 
Old 11-07-2016, 08:54 AM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,939
Blog Entries: 4

Rep: Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018
Can it run Linux, or any stripped-down flavor of the same? Does "the operating system that came with it" implement multitasking?

Any CPU can potentially implement some form of multitasking, and, these days, most of them do. You do not have to have "multiple cores."

(In this discussion, I'm going to be loose-and-easy with terminology. I'm going to omit discussion of "threads" and speak only of "processes," just for clarity. "Threads" are implied. "Task" colloquially means "process" (or "thread"). I'm painting with a very broad brush ...)

In essence, multitasking allows the operating system to recognize "multiple available units-of-work," otherwise known as "processes." At any particular nanosecond, some of them are "runnable right now," while the others are "waiting" for some reason. The operating system's scheduler chooses which runnable task should run next. It hands-over control to that task, after setting a timer. The task will now run until it yields the remainder of its "time-slice," or until the timer "pops" (or a hardware or software interrupt comes in ...) and the task is pre-empted.

"pthread" is a well-defined and more-or-less operating-system independent interface to multitasking capability, but in a robot you might have other choices, too.

For instance, you could have non-preemptive multitasking, in which every task is obliged to call some kind of (say ...) yield() subroutine "frequently" (and the system will "hang" if they don't). Through the simple expedient of swapping sets of processor registers (and, without the need for privileged machine instructions), the tasks voluntarily "pass the baton." Each process runs until it gives up the CPU, and eventually it sees that "the yield() subroutine 'returned,'" although any number of other processes might have taken their turn in the meantime. You can achieve a very useful set of functionality in this way, with a remarkable economy of code (and great efficiency), provided that all processes concerned "know and trust one another" (as they would, in a robot).

Last edited by sundialsvcs; 11-07-2016 at 09:05 AM.
 
Old 11-08-2016, 02:14 PM   #3
lukecam1995
LQ Newbie
 
Registered: Oct 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
Update:

Thanks all sorted!
 
  


Reply

Tags
background, posix, server, sockets, threads


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Posix Threads Rebold Programming 4 03-14-2012 10:10 AM
Any Linux for Marvell PXA270 and PXA3xx processor? yklee_hk Linux - Newbie 2 01-20-2010 05:52 PM
POSIX Threads embesil Programming 4 03-07-2009 02:03 PM
POSIX Threads mannahazarika Programming 4 07-17-2006 12:00 AM
About POSIX threads Ephracis Programming 1 12-03-2004 07:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:06 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