EmbeddedRelated.com
Forums

How to design non blocking device drivers?

Started by ssubbarayan September 18, 2008
On Thu, 18 Sep 2008 06:54:59 -0700, ssubbarayan wrote:

> Hi all, > I would like to understand how to design drivers in such a way > that its non blocking? > > To be more specific,If suppose I have an EEPROM device and two tasks are > trying to write some data to the EEPROM device,generally what happens > is,we will have a semaphore inside driver so that till one task > completes using the device,the other task will be pending to complete > the writing.What would be the way to design the driver in such a way > that the second task mentioned above does not go into blocking,but still > completes writing to the EEPROM. > > Sorry if this query looks naive,I am trying to think on alternatives for > one our product.Application is a thirdparty application which needs this > requirement. > > Looking farward for your thoughts and advanced thanks for the same, > > Regards, > s.subbarayan
The EEPROM is, itself, blocking (you can't initiate a write while it's writing), so a driver for it is either going to reflect that, or you're going to have to mirror the EEPROM and schedule writes. So your choice is blocking, or a fairly complex shadowing scheme. -- Tim Wescott Control systems and communications consulting http://www.wescottdesign.com Need to learn how to apply control theory in your embedded system? "Applied Control Theory for Embedded Systems" by Tim Wescott Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html