[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] On Hurd, don't use not implemented madvise()

From: tomas
Subject: Re: [PATCH] On Hurd, don't use not implemented madvise()
Date: Sat, 3 Jun 2017 08:41:32 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Hash: SHA1

On Fri, Jun 02, 2017 at 10:00:18PM -0400, Mark H Weaver wrote:
> <address@hidden> writes:


> > This would at least suggest having a way to query whether madvise is
> > available, through some introspection (giving the program a chance
> > to adapt its behavior)?
> First of all, you should read this for background:


> If you've done that, then you should understand that this new feature in
> guile-2.2 fundamentally changes the way we can express loops in Scheme
> that build recursive data structures where scalability is important.


Yes, I got that: in a nutshell, getting the stack auto-extended instead
of being blown out of existence by a segfault or similar.

> Consider how frequently patterns like this occur.  Do you really want to
> duplicate every piece of code with a loop of this form?  It would be
> better to just give up on this new feature entirely.
> Anyway, even if you did duplicate your code, that would not solve the
> problem, because many procedures in Guile itself are now written in the
> nicer way to take advantage of this.  One such example is 'map'.

You are right, duplicating every piece of code doesn't seem to be
a Good Thing.

I rather proposed the introspection for those who want to come up
with whatever other ideas: it might be they'll want to warn the user
right off at the beginning ("uh, oh: no madvise: expect a rough ride",
so they can then segfault without guilt :)

> I'm quite fond of the Hurd design, and I hope it continues to grow, but
> it's unrealistic to expect developers to write loops like this in a
> fundamentally less clear way to cater to an experimental OS that has so
> few users.
> Does that make sense?

It does. As I said, I just proposed that, if Guile decides to use
madvise() dynamically (by "bypassing" ENOSYS -- that's IMO a good idea
anyway), it should give the user a possibility to check for that very
fact ("do we, actually, have an madvise()?"). WDYT?

- -- tomás

>        Mark
Version: GnuPG v1.4.12 (GNU/Linux)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]