[twg-tds] storing scripts in the texmf tree

Olaf Weber olaf at infovore.xs4all.nl
Fri Feb 13 19:51:30 CET 2004

Hans Hagen writes:
> At 20:41 12/02/2004, Olaf Weber wrote:

>> Based on some private feedback from Hans, let me describe what I've
>> implemented the successor to kpathsea (call it kpse).  In kpse, there
>> is a kpse.cnf file (the name is determined by the app using kpse),
>> which contains sections describing formats like this:

> since there will be a new library ...

Unfortunately it looks unlikely to be available in time for the next

> on windows, fabrice uses a shared memory approach, which means that
> for write18 sub processes, no loading of the dstabase takes place (on
> windows this is a big speedup because there all names have to be
> converted to unicode)

> the disadvantage is that one cannot run multiple jobs at the same time
> that use a differen tree

> also, at tug 2002 (india) karel skoupy demonstrated that when run as a
> service, kpse was faster

> so ... will the next release / new version provide:

> -  a service (on some port)

Not implemented (yet).

> -  shared memory for subprocesses

As currently implemented, the datastructures are not suitable for
this.  In test versions I have been playing with datastructures that
are (they have to be independent of the address at which the data is

> -  multiple simultaneously (main) tree support

With the most plausible implementation, one kpsed would serve a single
tree.  To have multiple simultanous trees then requires multiple kpsed

For a shared memory implementation, _if_ I'd be doing it, the
"obvious" way to implement it would be to add arguments that specify
the segments (plural, see above) in question.  If not explicitly given
the ids of the segments to attach to, kpse would not attempt to do so,
instead creating its own segments as it initialised its databases.

In UNIX terms:
 - use shmget(key, size, IPC_CREAT|IPC_EXCL) to create new segments
 - use shmat(shmid, NULL, SHM_RDONLY) to attach to the segment in the
 - given the strict parent-child relationships between processes the
   parent process that did the shmget call for the segment can do the
   shmctl(shmid, IPC_RMID, NULL) to ensure the segment gets deleted.
This should ensure that if you start several tex processes at the same
time, they'll keep out of each other's hair.  But as noted, this may
be very unix-centric.

Olaf Weber

               (This space left blank for technical reasons.)

More information about the twg-tds mailing list