• Linux kernel's RCU-protected hash tables (Re: Algorithm introduced inHogwild! SGD (Niu et al., 2011))

    From Mild Shock@janburse@fastmail.fm to sci.physics.relativity,sci.math,comp.lang.prolog on Mon Dec 1 22:26:06 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    An example of a lock free datastructure, that
    even doesn't use CAS, is for example:

    Read-Copy-Update (RCU) Based Hash Tables
    These use only memory barriers/fences and atomic pointer writes:
    - Basic approach: Readers access the table without locks,
    writers create new versions
    - Memory reclamation: Uses RCU grace periods instead of CAS
    - Example: Linux kernel's RCU-protected hash tables
    - Operations: Only requires atomic loads/stores and memory barriers

    For Prolog systems there are also various
    approaches arround, if one aims at the multi-threading
    model for dynamic databass or atom tables.

    I think this multi-threading model should be
    abadoned, in favor of things that can be speed
    up by a AI accelerator. Dogelog Player has abandoned

    multi-threading all together. But for example
    SWI-Prolog has heavily focused on lock free
    data structures already like 10 years ago,

    and it seems YAP can still not keep up with
    SWI-Prolog. See for example here:

    Yet Another Lock-Free Atom Table Design
    for Scalable Symbol Management in Prolog https://link.springer.com/article/10.1007/s10766-024-00766-z

    But in my opinion, in the light of the AI Boom,
    this is all amplified nonsense.

    Bye

    Mild Shock schrieb:
    Hi,

    What are you, a 5 year old moron?

    There are millions of algorithm that use volatile
    variables. Just look at the Java code base.

    But I was not refering to multi-threading, I
    was refering to PRAM for matrix operations.

    See for example here:

    Hogwild!: A Lock-Free Approach to
    Parallelizing Stochastic Gradient Descent
    https://arxiv.org/pdf/1106.5730

    Fuck off moron.

    Bye

    Blending Molostvov schrieb:
    Mild Shock wrote:

    What are you, a 5 year old moron?

    Pascual Sokolsky schrieb:
    Mild Shock wrote:

    But in principle the architecture is rather:

    parallel random-access machine (parallel RAM or PRAM) is a
    shared-memory abstract machine.
    https://en.wikipedia.org/wiki/Parallel_RAM

    The above class of machines is not widely know.
    But PRAM has been also studied, already in the 80's.

    parallel read of shared memory is only allowed to cia and the chinese
    governoment; must be somenthing you dont know

    from shared memory you only read and write sequential, me frendo,
    driven by semaphores, atomic instructions and so on. You are not that
    fucking stupid to write parallel to a cell, are you



    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to sci.physics.relativity,sci.math,comp.lang.prolog on Mon Dec 1 22:40:20 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    The Linux kernel's RCU-protected hash tables
    is still not free of problems. Multiple writers
    might still need extra work.

    String interning with a HashSet (no values, just keys)
    is actually easier to make lock-free without full
    CAS because you're only concerned with existence,

    not updates.

    Bye

    P.S.: I am not affected by this amplified nonsense.
    Dogelog Player has even no atom table. And since it
    is single threaded, the HashMap for predicate lookup

    is totally lock free. It is single threaded and it
    has cooperative multithreading. Internally it uses
    async/await from JavaScript for example, which is

    a cooperative multthreading approach, but from the
    outside it provides tasks and sleep and stuff.
    Recently demonstrated a little Strudel style music coding:

    Strudel Coding in Dogelog Player
    https://medium.com/2989/bbb9c78fcd67

    In basically declared multi-threading dead, before
    AI accelerators were there. I had more some worker
    things in mind, with more thorough siloing and isolation.

    But now that we have AI accelerators, the decision
    to abandon multithreadinhg looks even more splendid.

    Mild Shock schrieb:
    Hi,

    An example of a lock free datastructure, that
    even doesn't use CAS, is for example:

    Read-Copy-Update (RCU) Based Hash Tables
    These use only memory barriers/fences and atomic pointer writes:
    - Basic approach: Readers access the table without locks,
      writers create new versions
    - Memory reclamation: Uses RCU grace periods instead of CAS
    - Example: Linux kernel's RCU-protected hash tables
    - Operations: Only requires atomic loads/stores and memory barriers

    For Prolog systems there are also various
    approaches arround, if one aims at the multi-threading
    model for dynamic databass or atom tables.

    I think this multi-threading model should be
    abadoned, in favor of things that can be speed
    up by a AI accelerator. Dogelog Player has abandoned

    multi-threading all together. But for example
    SWI-Prolog has heavily focused on lock free
    data structures already like 10 years ago,

    and it seems YAP can still not keep up with
    SWI-Prolog. See for example here:

    Yet Another Lock-Free Atom Table Design
    for Scalable Symbol Management in Prolog https://link.springer.com/article/10.1007/s10766-024-00766-z

    But in my opinion, in the light of the AI Boom,
    this is all amplified nonsense.

    Bye

    Mild Shock schrieb:
    Hi,

    What are you, a 5 year old moron?

    There are millions of algorithm that use volatile
    variables. Just look at the Java code base.

    But I was not refering to multi-threading, I
    was refering to PRAM for matrix operations.

    See for example here:

    Hogwild!: A Lock-Free Approach to
    Parallelizing Stochastic Gradient Descent
    https://arxiv.org/pdf/1106.5730

    Fuck off moron.

    Bye

    Blending Molostvov schrieb:
    Mild Shock wrote:

    What are you, a 5 year old moron?

    Pascual Sokolsky schrieb:
    Mild Shock wrote:

    But in principle the architecture is rather:

    parallel random-access machine (parallel RAM or PRAM) is a
    shared-memory abstract machine.
    https://en.wikipedia.org/wiki/Parallel_RAM

    The above class of machines is not widely know.
    But PRAM has been also studied, already in the 80's.

    parallel read of shared memory is only allowed to cia and the chinese >>>>> governoment; must be somenthing you dont know

    from shared memory you only read and write sequential, me frendo,
    driven by semaphores, atomic instructions and so on. You are not that
    fucking stupid to write parallel to a cell, are you




    --- Synchronet 3.21a-Linux NewsLink 1.2