All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: Description of Voice call history plugin patch
Date: Thu, 16 Sep 2010 22:17:04 -0500	[thread overview]
Message-ID: <4C92DDB0.8010101@gmail.com> (raw)
In-Reply-To: <1284682387-22768-1-git-send-email-Rajyalakshmi.Bommaraju@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1434 bytes --]

Hi Raji,

> Design : Plugin uses memory mapped file for high performance input/output operations. File is used as cyclic queue for storing or reading records, it store s 50 records of 78bytes,hence fixed size file of 3916 bytes is used. File's first 16 bytes were used for storing header, and next 3900 bytes for data. Header structure has head pointer, tail pointer,unread and lastid. Head pointer points to next slot for writing record into,tail for reading record, unread for number of history records unread by client, lastid for id of the last record that is written.

Just a couple quick points.  Memory mapped files do not really give any
benefit over read/write/lseek for small files (e.g. less than a few
pages) with small record sizes (e.g. less than a 4K page.)  In fact
they're probably slower in these cases.

> Locking: 
> Accessing Memory mapped file pointer , all header fields (head,tail,unread,lastid), temp_unread,temp_tail are synchronized by a mutex. writing into memory file and reading from memory file happen asynchronously, so mutex is used to protect the memory mapped file pointer , header, temp_unread, temp_tail.

I'm totally confused by this one; you use no threads in your plugin (and
neither does oFono) and you have no external clients accessing the same
shared memory region.  It seems to me that locking is completely
unnecessary.

Am I missing something here?

Regards,
-Denis

  parent reply	other threads:[~2010-09-17  3:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-17  0:13 Description of Voice call history plugin patch Rajyalakshmi Bommaraju
2010-09-17  0:13 ` [PATCH] plugins: Adding implementation for persisting voice call history Rajyalakshmi Bommaraju
2010-09-17  1:14   ` Marcel Holtmann
2010-09-17  3:17 ` Denis Kenzior [this message]
2010-09-17  6:32   ` Description of Voice call history plugin patch Bommaraju, Rajyalakshmi
2010-09-17  8:07     ` Marcel Holtmann
2010-09-17  8:16 ` Marcel Holtmann
2010-09-17 18:00   ` Bommaraju, Rajyalakshmi
2010-09-17 23:41     ` Marcel Holtmann
2010-09-20 18:52   ` Bommaraju, Rajyalakshmi
2010-09-21  2:37     ` Marcel Holtmann

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=4C92DDB0.8010101@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.