Hi,
Steinar Midtskogen:
> > Why not just add a lock around accesses to the relevant data structures?
>
> The idea behind the design is to able to access several owservers
> simultaniously; my 1-wire network is pretty big and I've split it into
> several seperate 1-wire adapters. More important, when one owserver
> is unreachable, offline, its physical bus is having problems etc and
> OW_get uses forever to return, that must not prevent data collection
> from other available sources.
True. So use a lock per source, and do not lock while accessing the bus.
Seems pretty straightforward to me, but then again ...
> I quickly found out that in order to achieve this, I need one process
> per source with its own OW_init, whereas OW_get seems to be
> threadsafe, but just in case I can have the program use fork instead
> of pthread_create, but I have the same two issues regardless of
> whether I use threads or separate processes.
>
OK, looks like it's a different problem then.
However, as I said, my reading of the source doesn't exactly fill me
with confidence wrt OW_get()'s thread safety.
--
Matthias Urlichs | {M:U} IT Design @ m-u-it.de | [email protected]
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
v4sw7$Yhw6+8ln7ma7u7L!wl7DUi2e6t3TMWb8HAGen6g3a4s6Mr1p-3/-6 hackerkey.com
- -
Remember: LSD absorbs 47 times it own weight in excess reality.
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers