Hi Paul,

> I'm not sure of the best way to handle this. Some thoughts:
> 1. limit the total requests being processed at the same time,
>    A  by not accepting new sockets until there is space, or
>    B. by returning an EBUSY error message.
> 2. try to merge requests. (Only works if the same request is pending
> -- not certain, and messy).
> 3. cancel older pending requests, either in progress, or ones waiting
> for the bus to be free.
> 4. limit uncached requests
> 5. limit slow requests -- e.g. temperature and humidity
>     A no limit on in-memory data (like device name)
>     B. no limit on cached data

In my opinion, the beauty of owfs is (for the most part) that it hides
all the low level complexity and allows the bus to be shared by
several users/applications.  So the expected behaviour probably is
that requests should only take longer time in busy situations, not
fail.  Of course, only up to a certain point where the user instead
would expect a timeout (EBUSY is probably ok if there are dozens of
requests already pending).

For my application (since I'm unfamiliar with the owfs code) I was
considering adding an extra thread doing all the queueing and the
actual OW_gets.  The queue can try to do a couple of clever things to
speed up processing/prevent the queue from growing too fast:

1) merge requests for the same value (I guess caching in a way already
does this, so requests for uncached values could be changed to cached
if there already is a pending request for the uncached value)

2) do some reordering so that requests for values on the same branches
get grouped to avoid a lot of switching (if the switching takes any
time to speak of).


As a quick fix to at least avoid crashes/lockups #1 looks good and may
also be a safeguard if more advanced queueing is adpopted later.

-- 
Steinar

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to