LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 05-06-2008, 05:11 PM   #1
jiankunli
LQ Newbie
 
Registered: May 2008
Posts: 2

Rep: Reputation: 0
multiple processes read from a device


I am working on a embedded system which has a ARM core and a DSP core. The ARM core acts as an application processor and DSP does the usual number-crunching stuff, such as FFT. We have a Linux OS running on top of ARM. A Linux process just treat DSP as a Linux device. Once a process want to do a FFT, it writes the command to the device. After DSP finishes with FFT, it interrupts the ARM and triggers the device to notify the requesting process.

This can be implemented by a typical "write/read" device model if DSP is used by only one process. However, there may have multiple processes trying to use FFT at the same time, which means device driver has to be able to handle multiple "write/read" requests. The "write" part can be easily implemented. However, once DSP finishes the request, how could the driver find out and notify the requesting process?

Last edited by jiankunli; 05-06-2008 at 05:17 PM.
 
Old 05-07-2008, 09:48 AM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939
You'd want to allow multiple processes to open the device at the same time, and this would give you a per-process individual passage through which to send and receive the information, wake up the correct process and so-on.
 
Old 05-09-2008, 04:31 PM   #3
jiankunli
LQ Newbie
 
Registered: May 2008
Posts: 2

Original Poster
Rep: Reputation: 0
sundialsvcs:

Thanks for the hint. Do you mind to refer to me any example driver code that implement process-based read/write?
 
Old 05-09-2008, 05:15 PM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
The interrupts could come back in any order, not necessarily in the order that the DSP received the writes. One way to keep track would be for the driver to pass a request number (PID?) to the DSP with each write and the DSP to return the request number with each interrupt so that the driver could match the interrupt to the corresponding write.

A much less desirable way to solve the problem would be for the ARM to use locks so that only one ARM thread at a time had a request outstanding in the DSP.

----------------
Steve Stites
 
  


Reply

Tags
driver, multiple, read



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
Multiple My Sql processes veenaonnet Linux - Newbie 1 05-03-2007 08:58 AM
How to read in a processes PID thedarkdestroyer Programming 3 05-09-2006 06:48 PM
Multiple threads vs Multiple processes deveraux83 Programming 1 05-11-2005 10:22 AM
Multiple Processes Appearing! Riddick SUSE / openSUSE 0 12-06-2004 05:27 PM
multiple instances of processes? ararag Linux - Software 2 07-31-2004 10:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 12:04 AM.

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