9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@swtch.com>
To: 9fans@9fans.net
Subject: Re: [9fans] store 9p session-only values using lib9p
Date: Wed, 11 Jun 2008 16:48:32 -0400	[thread overview]
Message-ID: <20080611204639.62E401E8C53@holo.morphisms.net> (raw)
In-Reply-To: <0c2d4885e85a65f8cb0fba1ed4d12336@9grid.es>

> If i save the offset adjustment in f->aux or simmilar,
> i can calculate the real file offset on the next T-reads,
> but that will only work if one client reads it at one time.

No it won't.  Even if just one client is reading, that client might seek.

You could assume that most reads will pick up where the
last one left off, and use f->aux to point at a single hint
that you can check.  Maybe you're willing to do more work
if you do get a seek.  Otherwise you'll need to build a more
complex data structure to help you map between the two.

Also, if f is a Fid* (not a File*), then you get a different f for each
different Topen of the file (and thus also for each client), so the
hint-per-Fid usually works pretty well in practice for this kind
of thing.

Russ



  reply	other threads:[~2008-06-11 20:48 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-11 20:06 gdiaz
2008-06-11 20:48 ` Russ Cox [this message]
2008-06-11 20:58   ` gdiaz
2008-06-11 23:44 ` erik quanstrom
2008-06-12  0:01   ` [9fans] upas/fs Russ Cox
2008-06-12  2:31     ` erik quanstrom
2008-06-12  2:59       ` Lyndon Nerenberg
2008-06-12  8:34   ` [9fans] store 9p session-only values using lib9p gdiaz
2008-06-12 10:04     ` erik quanstrom
2008-06-12 10:24       ` Fco. J. Ballesteros
2008-06-12 10:28         ` Fco. J. Ballesteros
2008-06-12 10:39         ` gdiaz
2008-06-12 10:43           ` Francisco J Ballesteros
2008-06-12 10:55             ` gdiaz
2008-06-12 11:04               ` Francisco J Ballesteros
2008-06-12 11:11                 ` gdiaz
2008-06-12 17:16                 ` lucio
2008-06-12 12:25         ` erik quanstrom
2008-06-12 12:32           ` erik quanstrom
2008-06-12 14:03           ` Francisco J Ballesteros
2008-06-12 14:25             ` erik quanstrom
2008-06-12 14:49               ` Fco. J. Ballesteros
2008-06-12 14:55                 ` Fco. J. Ballesteros
2008-06-12 15:06                 ` erik quanstrom
2008-06-12 17:12         ` lucio
2008-06-12 10:26       ` gdiaz
2008-06-12 11:09         ` erik quanstrom
2008-06-12 13:29           ` gdiaz
2008-06-12 14:10           ` Russ Cox
2008-06-12 14:10             ` erik quanstrom

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=20080611204639.62E401E8C53@holo.morphisms.net \
    --to=rsc@swtch.com \
    --cc=9fans@9fans.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).