This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

I/O thread safety


Hi,

I'd like to ask whether and how is the thread-safety
of the I/O subsystem approached - is this a problem
of application code, each subsystem, each driver,...?

I am implementing a driver for a CAN controller
connected via a SPI interface. Each CAN controller
transaction requires a few separate SPI transactions
that should not be interrupted by transactions done
from another thread (this can be probably fixed
to do everything in one SPI transaction, but
I'd like to ask anyway).

I am accessing the driver via the CYGPKG_IO_CAN layer.
The reads are normally executed by a message event loop
in one thread blocking until a CAN message arrives,
the writes are done from another thread.

To make things even more interesting both the SPI
and the CAN device are interrupt-driven...

What is the suggested approach to make this thread-safe?
A pointer to some example code is enough.


Thanks
-- 
                                  Stano

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]