From: Dennis Heuer <dh@triple-media.com>
To: linux-c-programming@vger.kernel.org
Subject: Re: how to best map/buffer a file to memory by being able to lock sequences thread-safe
Date: Tue, 16 Oct 2007 19:28:44 +0200 [thread overview]
Message-ID: <20071016192844.6305908c.dh@triple-media.com> (raw)
In-Reply-To: <18196.38985.711509.375651@cerise.gclements.plus.com>
On Tue, 16 Oct 2007 11:54:01 +0100
Glynn Clements <glynn@gclements.plus.com> wrote:
>
> Dennis Heuer wrote:
>
> > i did not try obstacks yet, will have a look at them. what bothers me
> > at the moment is that mremap() is not a standard and that it operates
> > strangely to me:
> >
> > ENOMEM
> > The region is private writable, and insufficient virtual memory is
> > available to extend it. Also, this error will occur if MREMAP_MAYMOVE
> > is not given and the extension would collide with another mapped region.
> >
> > i thought that mmap'ed space is only virtually aligned. possibly it's
> > better to write buffers oneself? the posix interfaces look strange to
> > me. they seem halfhearted and weirdly incompatible.
>
> I don't understand what you're saying in any of the preceding
> paragraph.
i actually don't understand why you don't understand :( possibly i
should've written 'caches' instead of 'buffers'. however, what shall i
use a posix interface for if it only works in this but not in that case
and then only inefficient, as you yourself mentioned. efficiency is
quite important. portability too. the documentation is also bad. one
never knows what's meant with 'process', if things are thread-safe
or how they behave in combination (if that's not strictly forbidden.)
posix is an assortment but not a structure or even a base. however, i
found out that some interfaces aren't supported by cygwin and will
write the file cache and my memory buffers myself based on malloc, even
if that means that i now have to implement an efficient tree. it also
means that one always again invents the wheel though the system already
has it implemented but doesn't like to offer it a sane way. sorry but
i'm quite pissed about posix at the moment.
regards,
dennis heuer
next prev parent reply other threads:[~2007-10-16 17:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-12 22:01 how to best map/buffer a file to memory by being able to lock sequences thread-safe Dennis Heuer
2007-10-13 16:00 ` Glynn Clements
2007-10-15 15:46 ` Dennis Heuer
2007-10-16 10:54 ` Glynn Clements
2007-10-16 17:28 ` Dennis Heuer [this message]
2007-10-16 18:44 ` Glynn Clements
2007-10-17 14:42 ` Bryan Christ
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=20071016192844.6305908c.dh@triple-media.com \
--to=dh@triple-media.com \
--cc=linux-c-programming@vger.kernel.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 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).