Re: Compiling on Termux - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: Compiling on Termux
Date
Msg-id CAEepm=1vQhcSPwzToFjCTzehG-k0ysSv-RgEdrXyU68SC_ubaQ@mail.gmail.com
Whole thread Raw
In response to Re: Compiling on Termux  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sat, Dec 22, 2018 at 11:51 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Thomas Munro <thomas.munro@enterprisedb.com> writes:
> > On Sat, Dec 22, 2018 at 9:19 AM David Fetter <david@fetter.org> wrote:
> >> I don't know precisely how it's going to play with Postgres, but
> >> Termux does supply a Postgres in its native packages.  That package
> >> appears to work, at least in the single-connection case, so they're
> >> doing something somehow to get it up and running.
>
> > They use libandroid-shmem which emulates SysV shmem.
>
> Interesting.  I wonder how well it emulates the aspect we actually
> care about, ie counting the number of attached processes correctly ...

I hadn't paid much attention to Android before, but it's quite
impressive that it can run PostgreSQL.  One interesting thing (to me
at least) is that although it's some kind of Linux kernel, it has a
new libc called Bionic that is a mixture of cleanroom bits and *BSD
bits, probably because they liked the licence better[1].  The
allocator is jemalloc so I wonder if it eats 40k for every 32k hash
join chunk.

I wonder if we could mmap a small file created by initdb under pgdata
and do a new kind of interlocking in there, so you don't need SysV shm
at all.  That would work for Android (which is obviously just a
curiosity for now, but kinda neat), and maybe also some other
interesting new platforms like CloudABI[2] that get rid of global
stuff like the System V facilities, so that you can trap software
entirely inside a root directory identified by an inherited file
descriptor (not that I have seriously studied what else would be
required to run in that environment).

[1] https://en.wikipedia.org/wiki/Bionic_(software)
[2] https://archive.fosdem.org/2017/schedule/event/cloudabi/

-- 
Thomas Munro
http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: removal of dangling temp tables
Next
From: Etsuro Fujita
Date:
Subject: Re: Problems with plan estimates in postgres_fdw