Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #39585

Re: Threads [Was: Get real, user and system time]

From Martin Gregorie <martin@mydomain.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Threads [Was: Get real, user and system time]
Date 2020-07-21 23:14 +0000
Organization A noiseless patient Spider
Message-ID <rf7srs$6nm$1@dont-email.me> (permalink)
References <87o8oc99wk.fsf@munus.decebal.nl> <rf5a0m$q3a$1@dont-email.me> <rf6kur$apm$1@dont-email.me> <rf6nrs$42m$1@dont-email.me> <rf76lq$rq0$1@dont-email.me>

Show all headers | View raw


On Tue, 21 Jul 2020 16:55:22 +0000, Martin Gregorie wrote:

> - multiple, separately forked, processes that access one or more shared
>   memory modules.
> 
> These will look different when looked at by top and similar tools though
> use the same basic tools (semaphores, locks, etc).
>
I should have added that this is a more thread-safe way to write C, but 
of course its sort of irrelevant to Java because the latter's memory 
management is much safer, especially for strings: not allowing space for 
the terminating NULL (or forgetting to append the NULL if you're 
assembling a string are  classic ways of causing a segfault crash.

There are other uses for shared memory: in the system which had the slow 
lookup problem we handled the log files by reading each into a 1-2MB 
chunk of shared memory by the log loader process. It then handed the 
shared memory pointer to a file control process. Then, as each task in 
the data prep chain, i.e. the dimension key lookups and database loader 
finished processing a log, it released its connection to log, causing the 
file controller to mark it log as ready for the next process in the line, 
and requested a connection to the next available log.

This was inherently fast because it each log file was only loaded into 
memory while being formatted with NULLS where the integer keys would go. 
This done, the log didn't move in memory or have its size changed until 
it had been loaded into the database and deleted.


-- 
Martin    | martin at
Gregorie  | gregorie dot org

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Get real, user and system time Cecil Westerhof <Cecil@decebal.nl> - 2020-07-18 16:26 +0200
  Re: Get real, user and system time Martin Gregorie <martin@mydomain.invalid> - 2020-07-18 20:59 +0000
    Re: Get real, user and system time Luuk <luuk@invalid.lan> - 2020-07-20 08:06 +0200
      Re: Get real, user and system time Martin Gregorie <martin@mydomain.invalid> - 2020-07-20 08:55 +0000
  Re: Get real, user and system time Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2020-07-21 01:40 +0200
    Re: Get real, user and system time Martin Gregorie <martin@mydomain.invalid> - 2020-07-21 11:52 +0000
      Threads [Was: Get real, user and system time] Eric Sosman <esosman@comcast-dot-net.invalid> - 2020-07-21 08:42 -0400
        Re: Threads [Was: Get real, user and system time] Martin Gregorie <martin@mydomain.invalid> - 2020-07-21 16:55 +0000
          Re: Threads [Was: Get real, user and system time] Eric Sosman <esosman@comcast-dot-net.invalid> - 2020-07-21 15:46 -0400
            Re: Threads [Was: Get real, user and system time] Martin Gregorie <martin@mydomain.invalid> - 2020-07-21 20:16 +0000
          Re: Threads [Was: Get real, user and system time] Martin Gregorie <martin@mydomain.invalid> - 2020-07-21 23:14 +0000
      Re: Get real, user and system time Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2020-07-22 00:23 +0200

csiph-web