chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] mmap


From: Christian Kellermann
Subject: Re: [Chicken-hackers] mmap
Date: Fri, 11 Jul 2014 10:42:43 +0200
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.3 (berkeley-unix)

Felix Winkelmann <address@hidden> writes:

> From: Andy Bennett <address@hidden>
> Subject: mmap (was: Re: [Chicken-hackers] library unit restructuring)
> Date: Wed, 09 Jul 2014 14:56:38 +0100
>
>> Hi,
>> 
>>>   - memory-mapped-files
>> 
>> Without wishing to hijack the entire thread, as an aside, is there any
>> way of making memory mapped files play nicely with the CHICKEN scheduler
>> and threading model? It's possible for memory mapped files to cause a
>> page fault which will then wait for I/O and, as I understand it, that
>> will block the entire runtime.
>
> Since nobody replied to this - I wouldn't know how this is done.  I
> guess there is some UNIX arcana that allows one to implement
> non-blocking behaviour. As memory access will cause the blocking, we
> can probably not check for this via poll/select. Do you have any
> information about this? Is it possible to test whether a page is in
> memory, and whether one can do the equivalent of a poll/select on
> this?

IIRC mmap's flags MAP_NONBLOCK and MAP_POPULATE are linux specific and
don't exist in all our other platforms, notably the *BSDs. Since mmap
calls return a pointer to memory, the usual select/poll syscalls cannot
be applied to it.

(Also note that MAP_POPULATE is ignored in recent kernels even).

Andy, can you elaborate on the blocking scenario you are seeing?

HTH,

Christian




reply via email to

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