• Stand alone version of Bonita call once...

    From Chris M. Thomasson@3:633/10 to All on Fri Jan 2 19:59:40 2026
    The (bool) cast wrt callable fiasco aside for a moment. This version has
    the fences exactly where they need to be. Using C++ CAS with its membar
    A for true and membar B for fail is RIPE for bugs anyway, well, imvvho:


    #pragma once
    #include <concepts>
    #include <atomic>

    struct xonce_flag
    {
    xonce_flag() noexcept = default;
    private:
    friend bool xcall_once( xonce_flag &, std::invocable auto );
    using flag_t = std::atomic<signed char>;
    flag_t m_flag = 0;
    };

    bool xcall_once( xonce_flag &xflag, std::invocable auto callable )
    {
    using namespace std;
    xonce_flag::flag_t &flag = xflag.m_flag;
    for( signed char ref = flag.load( memory_order_relaxed ); ; )
    if( ref > 0 ) [[likely]]
    {

    std::atomic_thread_fence(std::memory_order_acquire);

    return true;
    }
    else if( ref < 0 ) [[unlikely]]
    {
    flag.wait( ref, memory_order_relaxed );
    ref = flag.load( memory_order_relaxed );
    }
    else if( flag.compare_exchange_strong( ref, -1,
    memory_order_relaxed, memory_order_relaxed ) ) [[likely]]
    break;
    bool succ = true;

    std::atomic_thread_fence(std::memory_order_acquire);

    try
    {
    if constexpr( requires { (bool)callable(); } )
    succ = (bool)callable();
    else
    callable();
    }
    catch( ... )
    {
    std::atomic_thread_fence(std::memory_order_release);

    flag.store( 0, memory_order_relaxed );
    flag.notify_one();
    throw;
    }

    std::atomic_thread_fence(std::memory_order_release);

    flag.store( (char)succ, memory_order_relaxed );
    if( succ )
    flag.notify_all();
    else
    flag.notify_one();
    return succ;
    }


    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Bonita Montero@3:633/10 to All on Sat Jan 3 05:02:32 2026
    You're making my code more complicated for nothing.

    Am 03.01.2026 um 04:59 schrieb Chris M. Thomasson:
    The (bool) cast wrt callable fiasco aside for a moment. This version
    has the fences exactly where they need to be. Using C++ CAS with its
    membar A for true and membar B for fail is RIPE for bugs anyway, well, imvvho:


    #pragma once
    #include <concepts>
    #include <atomic>

    struct xonce_flag
    {
    ÿÿÿ xonce_flag() noexcept = default;
    private:
    ÿÿÿ friend bool xcall_once( xonce_flag &, std::invocable auto );
    ÿÿÿ using flag_t = std::atomic<signed char>;
    ÿÿÿ flag_t m_flag = 0;
    };

    bool xcall_once( xonce_flag &xflag, std::invocable auto callable )
    {
    ÿÿÿ using namespace std;
    ÿÿÿ xonce_flag::flag_t &flag = xflag.m_flag;
    ÿÿÿ for( signed char ref = flag.load( memory_order_relaxed ); ; )
    ÿÿÿÿÿÿÿ if( ref > 0 ) [[likely]]
    ÿÿÿÿÿÿÿ {

    ÿÿÿÿÿÿÿÿÿÿÿ std::atomic_thread_fence(std::memory_order_acquire);

    ÿÿÿÿÿÿÿÿÿÿÿ return true;
    ÿÿÿÿÿÿÿ }
    ÿÿÿÿÿÿÿ else if( ref < 0 ) [[unlikely]]
    ÿÿÿÿÿÿÿ {
    ÿÿÿÿÿÿÿÿÿÿÿ flag.wait( ref, memory_order_relaxed );
    ÿÿÿÿÿÿÿÿÿÿÿ ref = flag.load( memory_order_relaxed );
    ÿÿÿÿÿÿÿ }
    ÿÿÿÿÿÿÿ else if( flag.compare_exchange_strong( ref, -1, memory_order_relaxed, memory_order_relaxed ) ) [[likely]]
    ÿÿÿÿÿÿÿÿÿÿÿ break;
    ÿÿÿ bool succ = true;

    ÿÿÿ std::atomic_thread_fence(std::memory_order_acquire);

    ÿÿÿ try
    ÿÿÿ {
    ÿÿÿÿÿÿÿ if constexpr( requires { (bool)callable(); } )
    ÿÿÿÿÿÿÿÿÿÿÿ succ = (bool)callable();
    ÿÿÿÿÿÿÿ else
    ÿÿÿÿÿÿÿÿÿÿÿ callable();
    ÿÿÿ }
    ÿÿÿ catch( ... )
    ÿÿÿ {
    ÿÿÿÿÿÿÿ std::atomic_thread_fence(std::memory_order_release);

    ÿÿÿÿÿÿÿ flag.store( 0, memory_order_relaxed );
    ÿÿÿÿÿÿÿ flag.notify_one();
    ÿÿÿÿÿÿÿ throw;
    ÿÿÿ }

    ÿÿÿ std::atomic_thread_fence(std::memory_order_release);

    ÿÿÿ flag.store( (char)succ, memory_order_relaxed );
    ÿÿÿ if( succ )
    ÿÿÿÿÿÿÿ flag.notify_all();
    ÿÿÿ else
    ÿÿÿÿÿÿÿ flag.notify_one();
    ÿÿÿ return succ;
    }



    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Fri Jan 2 20:09:25 2026
    On 1/2/2026 8:02 PM, Bonita Montero wrote:
    You're making my code more complicated for nothing.

    I think it makes it MUCH easier to read, and performs just as well. The membars are exactly right where they need to be.


    Am 03.01.2026 um 04:59 schrieb Chris M. Thomasson:
    The (bool) cast wrt callable fiasco aside for a moment. This version
    has the fences exactly where they need to be. Using C++ CAS with its
    membar A for true and membar B for fail is RIPE for bugs anyway, well,
    imvvho:


    #pragma once
    #include <concepts>
    #include <atomic>

    struct xonce_flag
    {
    ÿÿÿ xonce_flag() noexcept = default;
    private:
    ÿÿÿ friend bool xcall_once( xonce_flag &, std::invocable auto );
    ÿÿÿ using flag_t = std::atomic<signed char>;
    ÿÿÿ flag_t m_flag = 0;
    };

    bool xcall_once( xonce_flag &xflag, std::invocable auto callable )
    {
    ÿÿÿ using namespace std;
    ÿÿÿ xonce_flag::flag_t &flag = xflag.m_flag;
    ÿÿÿ for( signed char ref = flag.load( memory_order_relaxed ); ; )
    ÿÿÿÿÿÿÿ if( ref > 0 ) [[likely]]
    ÿÿÿÿÿÿÿ {

    ÿÿÿÿÿÿÿÿÿÿÿ std::atomic_thread_fence(std::memory_order_acquire);

    ÿÿÿÿÿÿÿÿÿÿÿ return true;
    ÿÿÿÿÿÿÿ }
    ÿÿÿÿÿÿÿ else if( ref < 0 ) [[unlikely]]
    ÿÿÿÿÿÿÿ {
    ÿÿÿÿÿÿÿÿÿÿÿ flag.wait( ref, memory_order_relaxed );
    ÿÿÿÿÿÿÿÿÿÿÿ ref = flag.load( memory_order_relaxed );
    ÿÿÿÿÿÿÿ }
    ÿÿÿÿÿÿÿ else if( flag.compare_exchange_strong( ref, -1,
    memory_order_relaxed, memory_order_relaxed ) ) [[likely]]
    ÿÿÿÿÿÿÿÿÿÿÿ break;
    ÿÿÿ bool succ = true;

    ÿÿÿ std::atomic_thread_fence(std::memory_order_acquire);

    ÿÿÿ try
    ÿÿÿ {
    ÿÿÿÿÿÿÿ if constexpr( requires { (bool)callable(); } )
    ÿÿÿÿÿÿÿÿÿÿÿ succ = (bool)callable();
    ÿÿÿÿÿÿÿ else
    ÿÿÿÿÿÿÿÿÿÿÿ callable();
    ÿÿÿ }
    ÿÿÿ catch( ... )
    ÿÿÿ {
    ÿÿÿÿÿÿÿ std::atomic_thread_fence(std::memory_order_release);

    ÿÿÿÿÿÿÿ flag.store( 0, memory_order_relaxed );
    ÿÿÿÿÿÿÿ flag.notify_one();
    ÿÿÿÿÿÿÿ throw;
    ÿÿÿ }

    ÿÿÿ std::atomic_thread_fence(std::memory_order_release);

    ÿÿÿ flag.store( (char)succ, memory_order_relaxed );
    ÿÿÿ if( succ )
    ÿÿÿÿÿÿÿ flag.notify_all();
    ÿÿÿ else
    ÿÿÿÿÿÿÿ flag.notify_one();
    ÿÿÿ return succ;
    }




    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Bonita Montero@3:633/10 to All on Sat Jan 3 05:18:37 2026
    Am 03.01.2026 um 05:09 schrieb Chris M. Thomasson:
    On 1/2/2026 8:02 PM, Bonita Montero wrote:
    You're making my code more complicated for nothing.
    I think it makes it MUCH easier to read, and performs just as well.
    The membars are exactly right where they need to be.

    You're crazy.


    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Sat Jan 3 11:43:52 2026
    On 1/2/2026 8:18 PM, Bonita Montero wrote:
    Am 03.01.2026 um 05:09 schrieb Chris M. Thomasson:
    On 1/2/2026 8:02 PM, Bonita Montero wrote:
    You're making my code more complicated for nothing.
    I think it makes it MUCH easier to read, and performs just as well.
    The membars are exactly right where they need to be.

    You're crazy.


    Na. (bool)callable, well, on the other hand... Shit happens.

    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Bonita Montero@3:633/10 to All on Sun Jan 4 08:14:22 2026
    Am 03.01.2026 um 20:43 schrieb Chris M. Thomasson:
    On 1/2/2026 8:18 PM, Bonita Montero wrote:
    Am 03.01.2026 um 05:09 schrieb Chris M. Thomasson:
    On 1/2/2026 8:02 PM, Bonita Montero wrote:
    You're making my code more complicated for nothing.
    I think it makes it MUCH easier to read, and performs just as well.
    The membars are exactly right where they need to be.
    You're crazy.
    Na. (bool)callable, well, on the other hand... Shit happens.

    That's while I intented this new kind of "once_flag"; to make
    *that* possible. I can't understand any objections against
    that; the interface is rather simple.
    The callback is concept'ed with std::invocable auto, i.e it
    must be callable without parameters; that makes the inter-
    face even easier to understand.


    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Sun Jan 4 14:21:12 2026
    On 1/3/2026 11:14 PM, Bonita Montero wrote:
    Am 03.01.2026 um 20:43 schrieb Chris M. Thomasson:
    On 1/2/2026 8:18 PM, Bonita Montero wrote:
    Am 03.01.2026 um 05:09 schrieb Chris M. Thomasson:
    On 1/2/2026 8:02 PM, Bonita Montero wrote:
    You're making my code more complicated for nothing.
    I think it makes it MUCH easier to read, and performs just as well.
    The membars are exactly right where they need to be.
    You're crazy.
    Na. (bool)callable, well, on the other hand... Shit happens.

    That's while I intented this new kind of "once_flag"; to make
    *that* possible. I can't understand any objections against
    that; the interface is rather simple.
    The callback is concept'ed with std::invocable auto, i.e it
    must be callable without parameters; that makes the inter-
    face even easier to understand.


    You need to document it, before anybody needs to read the code to find out.

    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Bonita Montero@3:633/10 to All on Mon Jan 5 00:59:20 2026
    Am 04.01.2026 um 23:21 schrieb Chris M. Thomasson:
    That's while I intented this new kind of "once_flag"; to make
    *that* possible. I can't understand any objections against
    that; the interface is rather simple.
    The callback is concept'ed with std::invocable auto, i.e it
    must be callable without parameters; that makes the inter-
    face even easier to understand.
    You need to document it, before anybody needs to read the code to find
    out.

    It's only one line of code to find that out (if constexpr( ... )).



    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Sun Jan 4 16:00:31 2026
    On 1/4/2026 3:59 PM, Bonita Montero wrote:
    Am 04.01.2026 um 23:21 schrieb Chris M. Thomasson:
    That's while I intented this new kind of "once_flag"; to make
    *that* possible. I can't understand any objections against
    that; the interface is rather simple.
    The callback is concept'ed with std::invocable auto, i.e it
    must be callable without parameters; that makes the inter-
    face even easier to understand.
    You need to document it, before anybody needs to read the code to find
    out.

    It's only one line of code to find that out (if constexpr( ... )).



    But, I mean for somebody who might want to use it. Why not document it
    up front?

    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Sun Jan 4 16:02:35 2026
    On 1/4/2026 3:59 PM, Bonita Montero wrote:
    Am 04.01.2026 um 23:21 schrieb Chris M. Thomasson:
    That's while I intented this new kind of "once_flag"; to make
    *that* possible. I can't understand any objections against
    that; the interface is rather simple.
    The callback is concept'ed with std::invocable auto, i.e it
    must be callable without parameters; that makes the inter-
    face even easier to understand.
    You need to document it, before anybody needs to read the code to find
    out.

    It's only one line of code to find that out (if constexpr( ... )).



    Oh no. If somebody wants to use it... I can see it now. The user asks so
    what are the rules of callable? You say read the code. That's like the opengroup saying read the code for a mutex impl to find out how it
    works. We don't need to document anything, just read the impl code.
    Common man!

    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Bonita Montero@3:633/10 to All on Mon Jan 5 01:04:37 2026
    Am 05.01.2026 um 01:02 schrieb Chris M. Thomasson:
    Oh no. If somebody wants to use it... I can see it now. The user asks
    so what are the rules of callable? You say read the code. That's like
    the opengroup saying read the code for a mutex impl to find out how it works. We don't need to document anything, just read the impl code.
    Common man!

    The code is easy to read.


    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Sun Jan 4 18:10:38 2026
    On 1/4/2026 4:04 PM, Bonita Montero wrote:
    Am 05.01.2026 um 01:02 schrieb Chris M. Thomasson:
    Oh no. If somebody wants to use it... I can see it now. The user asks
    so what are the rules of callable? You say read the code. That's like
    the opengroup saying read the code for a mutex impl to find out how it
    works. We don't need to document anything, just read the impl code.
    Common man!

    The code is easy to read.


    I can read it for sure. Yes I can understand it for sure. But, that (bool)callable() simply needs a clearly documented point. Fair enough?

    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Bonita Montero@3:633/10 to All on Mon Jan 5 19:39:23 2026
    Am 05.01.2026 um 03:10 schrieb Chris M. Thomasson:
    On 1/4/2026 4:04 PM, Bonita Montero wrote:
    Am 05.01.2026 um 01:02 schrieb Chris M. Thomasson:
    Oh no. If somebody wants to use it... I can see it now. The user
    asks so what are the rules of callable? You say read the code.
    That's like the opengroup saying read the code for a mutex impl to
    find out how it works. We don't need to document anything, just read
    the impl code. Common man!

    The code is easy to read.


    I can read it for sure. Yes I can understand it for sure. But, that (bool)callable() simply needs a clearly documented point. Fair enough?

    Sorry, if you understand the rest this part is rather easy to read
    if you can read concept'ed code.



    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Jan 5 12:34:57 2026
    On 1/5/2026 10:39 AM, Bonita Montero wrote:
    Am 05.01.2026 um 03:10 schrieb Chris M. Thomasson:
    On 1/4/2026 4:04 PM, Bonita Montero wrote:
    Am 05.01.2026 um 01:02 schrieb Chris M. Thomasson:
    Oh no. If somebody wants to use it... I can see it now. The user
    asks so what are the rules of callable? You say read the code.
    That's like the opengroup saying read the code for a mutex impl to
    find out how it works. We don't need to document anything, just read
    the impl code. Common man!

    The code is easy to read.


    I can read it for sure. Yes I can understand it for sure. But, that
    (bool)callable() simply needs a clearly documented point. Fair enough?

    Sorry, if you understand the rest this part is rather easy to read
    if you can read concept'ed code.



    Have you ever created documentation about your code before? I can
    imagine you creating a doc on, say, opengroup for a mutex:

    https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_lock.html

    You say read the code, instead of providing a detailed explanation.

    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Bonita Montero@3:633/10 to All on Tue Jan 6 06:07:46 2026
    Am 05.01.2026 um 21:34 schrieb Chris M. Thomasson:
    Have you ever created documentation about your code before? I can
    imagine you creating a doc on, say, opengroup for a mutex: https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_lock.html

    You say read the code, instead of providing a detailed explanation.

    I use Doxygen sometimes.
    But you think you're an expert in parallel programming.
    Then you should understand the code easily.
    It's only 34 lines of code.


    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Tue Jan 6 16:56:34 2026
    On 1/5/2026 9:07 PM, Bonita Montero wrote:
    Am 05.01.2026 um 21:34 schrieb Chris M. Thomasson:
    Have you ever created documentation about your code before? I can
    imagine you creating a doc on, say, opengroup for a mutex:
    https://pubs.opengroup.org/onlinepubs/9699919799/functions/
    pthread_mutex_lock.html
    You say read the code, instead of providing a detailed explanation.

    I use Doxygen sometimes.
    But you think you're an expert in parallel programming.

    I have had to correct you in the past. Remember?


    Then you should understand the code easily.
    It's only 34 lines of code.


    I do understand it! I even know how to make it use standalone fences.
    The (bool)callable raised some red flags. If you doc that clearly,
    well... Then, why not use it?

    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Tue Jan 6 17:02:37 2026
    On 1/6/2026 4:56 PM, Chris M. Thomasson wrote:
    On 1/5/2026 9:07 PM, Bonita Montero wrote:
    Am 05.01.2026 um 21:34 schrieb Chris M. Thomasson:
    Have you ever created documentation about your code before? I can
    imagine you creating a doc on, say, opengroup for a mutex:
    https://pubs.opengroup.org/onlinepubs/9699919799/functions/
    pthread_mutex_lock.html
    You say read the code, instead of providing a detailed explanation.

    I use Doxygen sometimes.
    But you think you're an expert in parallel programming.

    I have had to correct you in the past. Remember?

    It was fun when Sun gave me a T2000 sunfire before it was available for purchase by the general public.


    Then you should understand the code easily.
    It's only 34 lines of code.


    I do understand it! I even know how to make it use standalone fences.
    The (bool)callable raised some red flags. If you doc that clearly,
    well... Then, why not use it?


    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Bonita Montero@3:633/10 to All on Wed Jan 7 06:58:17 2026
    Am 07.01.2026 um 01:56 schrieb Chris M. Thomasson:
    On 1/5/2026 9:07 PM, Bonita Montero wrote:
    Am 05.01.2026 um 21:34 schrieb Chris M. Thomasson:
    Have you ever created documentation about your code before? I can
    imagine you creating a doc on, say, opengroup for a mutex:
    https://pubs.opengroup.org/onlinepubs/9699919799/functions/
    pthread_mutex_lock.html
    You say read the code, instead of providing a detailed explanation.

    I use Doxygen sometimes.
    But you think you're an expert in parallel programming.

    I have had to correct you in the past. Remember?


    Then you should understand the code easily.
    It's only 34 lines of code.


    I do understand it! I even know how to make it use standalone fences.
    The (bool)callable raised some red flags. If you doc that clearly,
    well... Then, why not use it?

    Clearly documented ...; dude that code is 34 only !


    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Bonita Montero@3:633/10 to All on Wed Jan 7 07:01:16 2026
    Am 07.01.2026 um 06:58 schrieb Bonita Montero:
    Clearly documented ...; dude that code is 34 only

    This is the unit-test:

    #include <iostream>
    #include <thread>
    #include <vector>
    #include <optional>
    #include <atomic>
    #include <barrier>
    #include "xonce.h"

    using namespace std;

    int main()
    {
    ÿ ÿ constexpr int N_THREADS = 10;
    ÿ ÿ atomic_int nTh = N_THREADS;
    ÿ ÿ optional<xonce_flag> flag;
    ÿ ÿ barrier bar( N_THREADS );
    ÿ ÿ vector<jthread> threads;
    ÿ ÿ atomic_int ctr = 0;
    ÿ ÿ for( int t = N_THREADS; t--; )
    ÿ ÿ ÿ ÿ threads.emplace_back( [&]
    ÿ ÿ ÿ ÿ ÿ ÿ {
    ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ for( size_t r = 1'000'000; r; --r )
    ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ {
    ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ if( !--nTh )
    ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ {
    ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ flag.emplace();
    ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ nTh = N_THREADS;
    ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ }
    ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ bar.arrive_and_wait();
    ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ xcall_once( *flag, [&ctr] { ++ctr; } );
    ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ }
    ÿ ÿ ÿ ÿ ÿ ÿ } );
    ÿ ÿ threads.resize( 0 );
    ÿ ÿ cout << ctr << endl;
    }


    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Tue Jan 6 22:15:24 2026
    On 1/6/2026 9:58 PM, Bonita Montero wrote:
    Am 07.01.2026 um 01:56 schrieb Chris M. Thomasson:
    On 1/5/2026 9:07 PM, Bonita Montero wrote:
    Am 05.01.2026 um 21:34 schrieb Chris M. Thomasson:
    Have you ever created documentation about your code before? I can
    imagine you creating a doc on, say, opengroup for a mutex:
    https://pubs.opengroup.org/onlinepubs/9699919799/functions/
    pthread_mutex_lock.html
    You say read the code, instead of providing a detailed explanation.

    I use Doxygen sometimes.
    But you think you're an expert in parallel programming.

    I have had to correct you in the past. Remember?


    Then you should understand the code easily.
    It's only 34 lines of code.


    I do understand it! I even know how to make it use standalone fences.
    The (bool)callable raised some red flags. If you doc that clearly,
    well... Then, why not use it?

    Clearly documented ...; dude that code is 34 only !


    I know the code is as is. But, well, what if somebody wants to use it as
    a primitive, and wants to read a spec, instead of the code?

    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Bonita Montero@3:633/10 to All on Wed Jan 7 07:45:41 2026
    Am 07.01.2026 um 07:15 schrieb Chris M. Thomasson:
    I know the code is as is. But, well, what if somebody wants to use it
    as a primitive, and wants to read a spec, instead of the code?

    The code doesn't need to be documented but the interface.


    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Wed Jan 7 12:54:14 2026
    On 1/6/2026 10:45 PM, Bonita Montero wrote:
    Am 07.01.2026 um 07:15 schrieb Chris M. Thomasson:
    I know the code is as is. But, well, what if somebody wants to use it
    as a primitive, and wants to read a spec, instead of the code?

    The code doesn't need to be documented but the interface.


    Right, and (bool)callable rules/spec needs to be in the docs.

    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)