From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 1/4] radio settings: allow for more than one property
Date: Thu, 21 Oct 2010 09:03:53 -0500 [thread overview]
Message-ID: <4CC04849.8070703@gmail.com> (raw)
In-Reply-To: <C358A26273CF2948B8BCDBA661A581782A7D03A877@NOK-EUMSG-03.mgdnok.nokia.com>
[-- Attachment #1: Type: text/plain, Size: 2683 bytes --]
Hi Mika,
On 10/21/2010 03:55 AM, Mika.Liljeberg(a)nokia.com wrote:
> Hi,
>
>> Please don't mix and match tabs and spaces for indentation
>
> Oops, will fix. For some reason my checkpatch script did not complain about this.
>
> You must be using a script as well. To avoid unnecessary fuss like this, would it be possible to integrate it to the oFono tree so everyone would check their patches using the same thing?
Not a script, but Johan's magic vim macro. I paste it here for reference:
highlight RedundantWhitespace ctermbg=red guibg=red
match RedundantWhitespace /\s\+$\|\t\+\ze \+[^*]\| \+\ze\t/
Between checkpatch, git am and this one we catch most issues.
>
>> I prefer you keep the current implementation as it is consistent with
>> the rest of ofono core. The way the rest of the core works
>> is that you
>> query each in sequence, then set the the CACHED flag (only one is
>> actually required).
>>
>> We use a single cached flag to keep the logic simpler and optimize for
>> the general case (e.g. UI will query the properties first before
>> allowing the user to set them) While this does lead to us
>> querying some
>> attributes unnecessarily in certain extremely unlikely corner cases, I
>> believe it is an acceptable compromise.
>
> This was my intention as well but I did it in a different way, as I didn't realize there was an existing pattern for it.
>
> My code does actually query all the properties up front but I serialized the driver queries in a different way. I.e., I used a separate CACHED flag for each property to keep track of whether the value is already valid. Each driver callback attempts to create the pending reply. The attempt to create the reply either succeeds or triggers a new driver query for another missing property value. This goes on until all the properties are cached and the pending reply can be sent.
>
> I now see that the other services use a separate state machine to fetch the properties. That introduces more code than my solution but I guess I can do it that way if you feel it is easier to read.
>
In the beginning we tried many approaches, including ones similar to the
path you took. We found that the current approach used in the core,
while while by no means perfect in every situation, was the best
compromise. It is quite scalable as the number of attributes / queries
grows and it blocks multiple (potentially malicious) applications from
DDoSing the modem when the information is not cached.
So while it might be a bit more code, I think it is the right approach
here as well; both for consistency and code readability reasons.
Regards,
-Denis
next prev parent reply other threads:[~2010-10-21 14:03 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-07 13:37 [PATCH 0/4] Support for fast dormancy - take 2 Mika Liljeberg
2010-10-07 13:37 ` [PATCH 1/4] radio settings: allow for more than one property Mika Liljeberg
2010-10-20 22:57 ` Denis Kenzior
2010-10-21 8:55 ` Mika.Liljeberg
2010-10-21 14:03 ` Denis Kenzior [this message]
2010-10-22 7:08 ` Mika.Liljeberg
2010-10-22 13:49 ` Denis Kenzior
2010-10-22 14:21 ` Mika.Liljeberg
2010-10-22 14:55 ` Denis Kenzior
2010-10-25 6:59 ` Mika.Liljeberg
2010-10-07 13:37 ` [PATCH 2/4] radio settings: add FastDormancy property Mika Liljeberg
2010-10-20 23:07 ` Denis Kenzior
2010-10-07 13:37 ` [PATCH 3/4] radio settings: document " Mika Liljeberg
2010-10-07 15:34 ` Marcel Holtmann
2010-10-08 6:56 ` Mika.Liljeberg
2010-10-08 8:55 ` Marcel Holtmann
2010-10-20 23:21 ` Denis Kenzior
2010-10-07 13:37 ` [PATCH 4/4] test: add scripts to enable and disable fast dormancy Mika Liljeberg
2010-10-20 23:09 ` Denis Kenzior
-- strict thread matches above, loose matches on Subject: below --
2010-10-07 13:21 [PATCH 0/4] Support for fast formancy Mika Liljeberg
2010-10-07 13:21 ` [PATCH 1/4] radio settings: allow for more than one property Mika Liljeberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CC04849.8070703@gmail.com \
--to=denkenz@gmail.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.