• Re: ?The end of software secrecy is almost upon

    From David Brown@3:633/10 to All on Sat Oct 24 12:38:36 2026
    On 23/10/2026 18:55, Peter Flass wrote:
    On 10/23/26 02:34, David Brown wrote:
    On 23/10/2026 05:21, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 15:41:15 -0500, Lynn McGuire wrote:

    I have been advocating for quite a while that C++ should add a user
    interface programming model for quite a long time.

    First they need a standardized graphics API.


    I hope that never happens.˙ There are large numbers of graphics APIs,
    with huge ranges of what they support, how they work and their balance
    between features, efficiency, portability, size, hardware support, and
    what they are used for.

    People who think C++ should have a standardised graphics API usually
    mean they want to standardise the API they use on the one application
    type that they write.


    I gather there?s been a proposal that?s been kicking around for some
    years, to adopt something based on Cairo
    <https://www.cairographics.org/>.


    You need something with subsets. At least a "basic" subset, a "full"
    subset, and something in between that satisfies most uses. Or maybe
    subsets for different purposes, but they should all be compatible.

    You can't do that for GUI's. All you get is a collection of subsets
    that are wrong for many people, and not nearly enough for most of them.

    Look at Python. It has a standard gui interface in the standard library
    - TKInter. Of serious Python programs with guis, it probably has a
    market share of a few percent - it's pretty much pointless having it in
    the standard library.

    There are a large number of gui toolkits used - QT, wx, GTK, SDL,
    "immediate mode" guis, embedded web browsers, etc. I have no
    statistics, but I doubt if there are any that have more than about 10% "market" share. Any many of these have wildly different paradigms - you
    can't easily combine them for a subset or abstraction.

    A standardised gui for C++ always sounds like a nice idea, but I can't
    see it being at all practical as part of the C++ standards process. At
    best, it could be a parallel setup with its own scheduling and its own publications. Trying to fit a gui into the model use for creating and maintaining the C++ standards would 5 years to produce a document that
    is 4 times the size of the current standard, 8 years out of date, and
    would be ignored by 95% of people writing gui programs in C++. And
    that's assuming you ignore one of the major users of C++ - the embedded
    world.




    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From David Brown@3:633/10 to All on Sat Oct 24 12:43:02 2026
    On 23/10/2026 18:57, Peter Flass wrote:
    On 10/23/26 02:45, David Brown wrote:
    On 23/10/2026 08:25, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 22:29:45 -0700, Chris M. Thomasson wrote:

    On 10/22/2026 8:19 PM, Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 07:26:21 -0700, Peter Flass wrote:

    That's why I try to use PL/I AUTOMATIC (stack) storage and not
    allocate a lot of stuff. You need to have a disciplined approach
    if you allocate random stuff here and there.

    What if you?re building an object that needs to be returned to the
    caller?

    Have the caller have the object before hand and call a function to
    initialize it?

    I?m assuming that all that BASIC programming hasn?t got to your head,
    and you?re not serious. ;)

    Chris' wording is perhaps poor, but the principle is right.

    I don't know PL/I or Fortran, but in C if you have :

    ˙˙˙˙˙typedef struct data_struct { int a; int xs[20]; } S ;

    ˙˙˙˙˙S build_some_data(void) {
    ˙˙˙˙˙˙˙˙ S s;

    ˙˙˙˙˙˙˙˙ s.a = 123;
    ˙˙˙˙˙˙˙˙ for (int i = 0; i < 20; i++) s.xs[i] = i;

    ˙˙˙˙˙˙˙˙ return s;
    ˙˙˙˙˙}

    ˙˙˙˙˙void foo() {
    ˙˙˙˙˙˙˙˙ S s = build_some_data();
    ˙˙˙˙˙}


    then it is typically handled as though you had written :

    ˙˙˙˙˙void build_some_data(S * p) {
    ˙˙˙˙˙˙˙˙ p->a = 123;
    ˙˙˙˙˙˙˙˙ for (int i = 0; i < 20; i++) p->xs[i] = i;

    ˙˙˙˙˙˙˙˙ return;
    ˙˙˙˙˙}

    ˙˙˙˙˙void foo() {
    ˙˙˙˙˙˙˙˙ S s;
    ˙˙˙˙˙˙˙˙ build_some_data(&s);
    ˙˙˙˙˙}


    That is - the caller creates the /space/ for the returned object, but
    does not do any kind of initialisation.˙ It passes a pointer to that
    space as a hidden parameter to the function that wants to return the
    object.

    That principle should work fine in any language, as long as the size
    of the returned object is known by the caller code.

    That last sentence is why it would not work fine,

    OK. Knowing the size of the returned object is an absolute requirement
    for pre-allocation by the caller, and it is a requirement that is fine
    for a lot of situations and a lot of languages. But if it is not the
    case for PL/I, Fortran, or any other particular language (or particular function in any language), then I fully agree - the object's space can't
    be handled by the caller.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Sat Oct 24 13:26:07 2026
    On 10/23/2026 8:33 PM, Lawrence D?Oliveiro wrote:
    On Fri, 23 Oct 2026 17:01:28 -0700, Chris M. Thomasson wrote:

    On 10/23/2026 3:42 PM, Lawrence D?Oliveiro wrote:

    On Fri, 23 Oct 2026 13:56:49 -0700, Chris M. Thomasson wrote:

    On 10/23/2026 12:19 PM, Lawrence D?Oliveiro wrote:

    In short, the concept doesn?t scale, because it completely breaks
    the concept of data abstraction.

    And it just pushes the dynamic-allocation problem elsewhere,
    without making it easier.

    It can be made to work ...

    I?m sure it?s *possible*, but what is the *point*?

    The whole aim of levels of abstraction is to tame the multi-headed
    beast of complexity that is computer programming. What you are
    doing here is breaking down those levels, all in the aid of, I
    don?t know, just to keep using gotos in your code, or something.

    Well, not about goto's and such. Just so a lib can inform the caller
    as to what it needs to work with. The caller sets it up, then calls
    into the init etc. Its being used in a lot of places. Take Vulkan.

    Where in Vulkan? Exposing implementation details to the caller not
    only increases complexity, it also limits the implementor?s ability to
    change those details later.

    Iiic, vkGetBufferMemoryRequirements and vkGetImageMemoryRequirements,
    which return a VkMemoryRequirements struct containing size, alignment,
    and memoryTypeBits. The caller allocates the memory with
    vkAllocateMemory and binds it with vkBindBufferMemory.

    Also, iirc io_uring: IORING_SETUP_NO_MMAP (Linux 6.5+) lets the caller
    supply the memory for the rings and SQE array. It must be suitably
    aligned (page or huge page), and the caller has to compute how big it
    needs to be from the entry count and flags.

    So it can be made to work.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Sat Oct 24 13:27:30 2026
    On 10/24/2026 1:26 PM, Chris M. Thomasson wrote:
    Iiic, vkGetBufferMemoryRequirements and vkGetImageMemoryRequirements,
    which return a VkMemoryRequirements struct containing size, alignment,
    and memoryTypeBits. The caller allocates the memory with
    vkAllocateMemory and binds it with vkBindBufferMemory.

    Also, iirc io_uring: IORING_SETUP_NO_MMAP (Linux 6.5+) lets the caller supply the memory for the rings and SQE array. It must be suitably
    aligned (page or huge page), and the caller has to compute how big it
    needs to be from the entry count and flags.

    So it can be made to work.

    Or what about miniaudio?s ma_engine_get_heap_size plus ma_engine_init_preallocated

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Sat Oct 24 22:32:03 2026
    On Sat, 24 Oct 2026 13:26:07 -0700, Chris M. Thomasson wrote:

    On 10/23/2026 8:33 PM, Lawrence D?Oliveiro wrote:

    On Fri, 23 Oct 2026 17:01:28 -0700, Chris M. Thomasson wrote:

    On 10/23/2026 3:42 PM, Lawrence D?Oliveiro wrote:

    The whole aim of levels of abstraction is to tame the
    multi-headed beast of complexity that is computer programming.
    What you are doing here is breaking down those levels, all in the
    aid of, I don?t know, just to keep using gotos in your code, or
    something.

    Well, not about goto's and such. Just so a lib can inform the
    caller as to what it needs to work with. The caller sets it up,
    then calls into the init etc. Its being used in a lot of places.
    Take Vulkan.

    Where in Vulkan? Exposing implementation details to the caller not
    only increases complexity, it also limits the implementor?s ability
    to change those details later.

    Iiic, vkGetBufferMemoryRequirements and
    vkGetImageMemoryRequirements, which return a VkMemoryRequirements
    struct containing size, alignment, and memoryTypeBits. The caller
    allocates the memory with vkAllocateMemory and binds it with vkBindBufferMemory.

    I had a quick look at that. It seems to have to do with the reality of
    graphics hardware implementing different kinds of memory with
    different kinds of characteristics, and the impossibility of
    completely such ignoring such issues in real-time 3D rendering.

    I expect higher-level APIs (e.g. game engines) will wrap all this
    behind their own higher-level abstractions, so regular
    programmers/game creators don?t have to worry about it.

    In short, it?s an abstraction that leaks that you accept only because
    you have to, not because it?s a good idea for abstractions in general.
    If you can successfully hide issues of memory and other resource
    allocation behind your abstraction, you would still rather do it than
    not.

    So, to get back to my point, the technique I use is based on a form of structured programming called a ?Nassi-Shneiderman diagram?. The
    overall structure looks like

    ... initialize object pointer to NULL ...
    do /*once*/
    {
    ... possible other stuff ...
    ... allocate object pointer ...
    if (error occurred)
    break;
    ... possible other stuff using object pointer ...
    }
    while (false);
    ... call free(3) (or equivalent) on object pointer ...

    So you can see there is no way out of the inner block without passing
    through the dispose call. Using gotos would contribute nothing except
    make it harder to assure yourself of the simplicity of the control
    flow.

    Looks deceptively simple. But the same technique can scale up to quite
    complex cases.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Sat Oct 24 22:32:25 2026
    On Sat, 24 Oct 2026 13:27:30 -0700, Chris M. Thomasson wrote:

    Or what about miniaudio?s ma_engine_get_heap_size plus ma_engine_init_preallocated

    No idea about that, but the same principle would apply.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Andreas Eder@3:633/10 to All on Sun Oct 25 16:31:56 2026
    On Fr 23 Okt 2026 at 22:49, Lawrence D?Oliveiro wrote:

    On Fri, 23 Oct 2026 21:00:30 -0000 (UTC), Thomas Koenig wrote:

    I have one Fortran program which has an excellent graphics API, it
    writes Postscript. Works fine. Can't do any mouse clicks on it and
    expect anything to happen, though :-)

    PostScript was a very influential graphics API, but it is only fit for
    the museum nowadays. It was designed for putting marks on paper, not
    for updating pixels on a computer screen.

    There was also display postscript from SUN.

    'Andreas
    --
    ceterum censeo redmondinem esse delendam

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Sun Oct 25 20:07:20 2026
    On Sun, 25 Oct 2026 16:31:56 +0100, Andreas Eder wrote:

    On Fr 23 Okt 2026 at 22:49, Lawrence D?Oliveiro wrote:

    PostScript was a very influential graphics API, but it is only fit
    for the museum nowadays. It was designed for putting marks on
    paper, not for updating pixels on a computer screen.

    There was also display postscript from SUN.

    Display PostScript was from Adobe.

    You could be thinking of NeWS, which was from Sun. It slightly
    predated X11, and they pretty much abandoned it after adopting X11
    wholesale, like the entire rest of the Unix industry.

    But neither Display PostScript nor NeWS made any changes to the
    PostScript graphics model; it was still designed around making marks
    on paper, not for updating pixels on a computer screen.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Sun Oct 25 14:36:44 2026
    On 10/25/2026 1:07 PM, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 16:31:56 +0100, Andreas Eder wrote:

    On Fr 23 Okt 2026 at 22:49, Lawrence D?Oliveiro wrote:

    PostScript was a very influential graphics API, but it is only fit
    for the museum nowadays. It was designed for putting marks on
    paper, not for updating pixels on a computer screen.

    There was also display postscript from SUN.

    Display PostScript was from Adobe.

    You could be thinking of NeWS, which was from Sun. It slightly
    predated X11, and they pretty much abandoned it after adopting X11
    wholesale, like the entire rest of the Unix industry.

    But neither Display PostScript nor NeWS made any changes to the
    PostScript graphics model; it was still designed around making marks
    on paper, not for updating pixels on a computer screen.

    Updating pixels on a computer screen? Use a frag shader.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Sun Oct 25 16:16:26 2026
    On 10/22/2026 10:29 PM, Chris M. Thomasson wrote:
    On 10/22/2026 8:19 PM, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 07:26:21 -0700, Peter Flass wrote:

    That's why I try to use PL/I AUTOMATIC (stack) storage and not
    allocate a lot of stuff. You need to have a disciplined approach if
    you allocate random stuff here and there.

    What if you?re building an object that needs to be returned to the
    caller?

    Have the caller have the object before hand and call a function to initialize it?

    Even analogous, to say, an API that says read n bytes and store into
    buffer. Well, the caller has lifetime of said buffer. The caller makes
    the buffer, calls into the function. The buffer bounds are known. Say a metadata stub:

    struct foobar_caller_alloc_helper
    {
    size_t m_size;
    size_t m_align;
    };





    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Mon Oct 26 00:42:55 2026
    On Sun, 25 Oct 2026 16:16:26 -0700, Chris M. Thomasson wrote:

    Even analogous, to say, an API that says read n bytes and store into
    buffer. Well, the caller has lifetime of said buffer. The caller makes
    the buffer, calls into the function.

    So how is the caller supposed to manage that memory?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Sun Oct 25 19:11:48 2026
    On 10/25/2026 5:42 PM, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 16:16:26 -0700, Chris M. Thomasson wrote:

    Even analogous, to say, an API that says read n bytes and store into
    buffer. Well, the caller has lifetime of said buffer. The caller makes
    the buffer, calls into the function.

    So how is the caller supposed to manage that memory?

    Ummm, say we wanted to have a buffer and use it.

    Say:

    {
    char buf[2048] = { '\0' };
    size_t bytes= foo_read(self, buf, 1024);
    }

    A caller provided buffer is normal with a lot of API's out there.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Sun Oct 25 19:21:00 2026
    On 10/25/2026 5:42 PM, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 16:16:26 -0700, Chris M. Thomasson wrote:

    Even analogous, to say, an API that says read n bytes and store into
    buffer. Well, the caller has lifetime of said buffer. The caller makes
    the buffer, calls into the function.

    So how is the caller supposed to manage that memory?

    Managing the memory is the caller?s job in C anyway. That?s the
    trade-off the language makes. read, recv, and mmap all work this way.
    This just applies the same contract to the lib?s own object.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Sun Oct 25 19:28:00 2026
    On 10/24/2026 3:32 PM, Lawrence D?Oliveiro wrote:
    I had a quick look at that. It seems to have to do with the reality of graphics hardware implementing different kinds of memory with
    different kinds of characteristics, and the impossibility of
    completely such ignoring such issues in real-time 3D rendering.

    I expect higher-level APIs (e.g. game engines) will wrap all this
    behind their own higher-level abstractions, so regular
    programmers/game creators don?t have to worry about it.

    In short, it?s an abstraction that leaks that you accept only because
    you have to, not because it?s a good idea for abstractions in general.
    If you can successfully hide issues of memory and other resource
    allocation behind your abstraction, you would still rather do it than
    not.

    So, to get back to my point, the technique I use is based on a form of structured programming called a ?Nassi-Shneiderman diagram?. The
    overall structure looks like

    ... initialize object pointer to NULL ...
    do /*once*/
    {
    ... possible other stuff ...
    ... allocate object pointer ...
    if (error occurred)
    break;
    ... possible other stuff using object pointer ...
    }
    while (false);
    ... call free(3) (or equivalent) on object pointer ...

    So you can see there is no way out of the inner block without passing
    through the dispose call. Using gotos would contribute nothing except
    make it harder to assure yourself of the simplicity of the control
    flow.

    Looks deceptively simple. But the same technique can scale up to quite complex cases.


    The graphics case is where the leak is unavoidable, but that?s not why
    I?d want it. A lib that never allocates behind your back is what you
    want in embedded, kernel, and arena code, and a foo_create wrapper on
    top gives you the hidden-allocation version for everyone else. Your
    do-once cleanup idiom works fine with it. You just call deinit and
    reclaim the block the way you made it. It?s a way to structure the
    caller?s error handling, and it doesn?t say anything about who owns the memory.

    Say memory on a threads stack, no free needed.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Mon Oct 26 03:39:38 2026
    On Sun, 25 Oct 2026 19:11:48 -0700, Chris M. Thomasson wrote:

    A caller provided buffer is normal with a lot of API's out there.

    No it isn?t. It?s not a good way to manage things, anyway: instead of
    solving the resource-allocation problem once and for all in the
    library API, you are pushing the burden onto all the client code, each
    one of which has to solve it for itself.

    That?s a dumb way to design things.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Mon Oct 26 03:40:23 2026
    On Sun, 25 Oct 2026 19:21:00 -0700, Chris M. Thomasson wrote:

    Managing the memory is the caller?s job in C anyway.

    Does that apply to the caller of library APIs like malloc(3) and
    free(3)?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Mon Oct 26 03:43:05 2026
    On Sun, 25 Oct 2026 19:28:00 -0700, Chris M. Thomasson wrote:

    A lib that never allocates behind your back is what you
    want in embedded, kernel, and arena code ...

    Even kernels want a common memory-management architecture, so addon
    modules don?t have to reinvent memory management on their own.

    Think of something like allocating low-priority cache memory, for
    stuff that can be dumped if necessary: that needs to be managed in the
    core of the kernel, so that if apps need regular memory for things
    they want to keep in memory, the kernel can free up cache as necessary
    to make more memory available.

    Stop trying to rationalize away the whole point of dynamic memory
    allocation.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Mon Oct 26 03:47:40 2026
    On Sun, 25 Oct 2026 22:54:14 -0400, Cryptoengineer wrote:

    I distinctly recall working with Sweet-16 on my ][+ back in the day,
    but can't recall the details.

    Interpreter for 16-bit integer arithmetic, according to <https://en.wikipedia.org/wiki/SWEET16>: ran at 1/10th the speed of
    native 6502 instructions, but took up just 300 bytes of RAM, but
    apparently cut the size of the whole Integer BASIC implementation by
    20%.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 13:23:59 2026
    On 10/25/2026 8:43 PM, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 19:28:00 -0700, Chris M. Thomasson wrote:

    A lib that never allocates behind your back is what you
    want in embedded, kernel, and arena code ...

    Even kernels want a common memory-management architecture, so addon
    modules don?t have to reinvent memory management on their own.

    Think of something like allocating low-priority cache memory, for
    stuff that can be dumped if necessary: that needs to be managed in the
    core of the kernel, so that if apps need regular memory for things
    they want to keep in memory, the kernel can free up cache as necessary
    to make more memory available.

    Stop trying to rationalize away the whole point of dynamic memory
    allocation.

    If you need dynamic memory fine. If a lib allocates things for itself,
    fine. Just make sure to know how to clean it up. Also, the caller can
    use dynamic memory if it wants to. RAII is pretty nice here.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 13:26:38 2026
    On 10/25/2026 8:39 PM, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 19:11:48 -0700, Chris M. Thomasson wrote:

    A caller provided buffer is normal with a lot of API's out there.

    No it isn?t. It?s not a good way to manage things, anyway: instead of
    solving the resource-allocation problem once and for all in the
    library API, you are pushing the burden onto all the client code, each
    one of which has to solve it for itself.

    That?s a dumb way to design things.

    HUH? How do you call say, fread without a user provided buffer?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 13:29:05 2026
    On 10/25/2026 8:40 PM, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 19:21:00 -0700, Chris M. Thomasson wrote:

    Managing the memory is the caller?s job in C anyway.

    Does that apply to the caller of library APIs like malloc(3) and
    free(3)?

    Yes. The caller calls malloc, if it succeeded, the caller needs to free
    what it got... Right?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 13:33:37 2026
    On 10/26/2026 1:29 PM, Chris M. Thomasson wrote:
    On 10/25/2026 8:40 PM, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 19:21:00 -0700, Chris M. Thomasson wrote:

    Managing the memory is the caller?s job in C anyway.

    Does that apply to the caller of library APIs like malloc(3) and
    free(3)?

    Yes. The caller calls malloc, if it succeeded, the caller needs to free
    what it got... Right?

    Say a lib that has foo_create... Well, the damn called must remember to
    call foo_destroy, right?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From David Brown@3:633/10 to All on Mon Oct 26 22:29:22 2026
    On 26/10/2026 21:29, Chris M. Thomasson wrote:
    On 10/25/2026 8:40 PM, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 19:21:00 -0700, Chris M. Thomasson wrote:

    Managing the memory is the caller?s job in C anyway.

    Does that apply to the caller of library APIs like malloc(3) and
    free(3)?

    Yes. The caller calls malloc, if it succeeded, the caller needs to free
    what it got... Right?

    Exactly. The caller is responsible for /managing/ the memory (or it can
    pass on that responsibility to something else). malloc and free are
    provide and dispose of memory, they do not manage it.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Mon Oct 26 21:45:20 2026
    On Mon, 26 Oct 2026 13:33:37 -0700, Chris M. Thomasson wrote:

    Say a lib that has foo_create... Well, the damn called must remember
    to call foo_destroy, right?

    Are you backpedalling from your previous idea that the caller must
    allocate the memory for the library to use?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Mon Oct 26 21:45:54 2026
    On Mon, 26 Oct 2026 13:26:38 -0700, Chris M. Thomasson wrote:

    HUH? How do you call say, fread without a user provided buffer?

    Relevance being?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Mon Oct 26 21:46:30 2026
    On Mon, 26 Oct 2026 13:23:59 -0700, Chris M. Thomasson wrote:

    If you need dynamic memory fine.

    What the hell do you think we have been talking about this whole
    time??

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 14:47:07 2026
    On 10/26/2026 2:45 PM, Lawrence D?Oliveiro wrote:
    On Mon, 26 Oct 2026 13:26:38 -0700, Chris M. Thomasson wrote:

    HUH? How do you call say, fread without a user provided buffer?

    Relevance being?

    Ummm... What we were talking about. You snipped a lot. See, the caller
    needs to have the buffer in order to call fread, right?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 14:51:57 2026
    On 10/26/2026 2:46 PM, Lawrence D?Oliveiro wrote:
    On Mon, 26 Oct 2026 13:23:59 -0700, Chris M. Thomasson wrote:

    If you need dynamic memory fine.

    What the hell do you think we have been talking about this whole
    time??

    Why do you "seem" to think we "always" need dynamic memory? Then you ask
    this gem:
    __________
    Does that apply to the caller of library APIs like malloc(3) and
    free(3)?
    __________

    See, the caller is responsible for managing things. Say foo_create that succeeds. Well, now the caller must call foo_destroy.



    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 14:53:48 2026
    On 10/26/2026 2:45 PM, Lawrence D?Oliveiro wrote:
    On Mon, 26 Oct 2026 13:33:37 -0700, Chris M. Thomasson wrote:

    Say a lib that has foo_create... Well, the damn called must remember
    to call foo_destroy, right?

    Are you backpedalling from your previous idea that the caller must
    allocate the memory for the library to use?

    Where did I say must? I said some libs allow the caller to create their internal state. You are the one that seems to not understand it? Either
    way, the caller needs to manage things in C. malloc/free, etc.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 14:58:35 2026
    On 10/26/2026 2:29 PM, David Brown wrote:
    On 26/10/2026 21:29, Chris M. Thomasson wrote:
    On 10/25/2026 8:40 PM, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 19:21:00 -0700, Chris M. Thomasson wrote:

    Managing the memory is the caller?s job in C anyway.

    Does that apply to the caller of library APIs like malloc(3) and
    free(3)?

    Yes. The caller calls malloc, if it succeeded, the caller needs to
    free what it got... Right?

    Exactly.˙ The caller is responsible for /managing/ the memory (or it can pass on that responsibility to something else).˙ malloc and free are
    provide and dispose of memory, they do not manage it.


    Right. For instance take my ralloc thing. A user can create a big pile
    of memory, have rallocex carve it up for them (align, etc), and use it.
    But, the user needs to know how to free that memory. If its on the
    stack, well, easy. If not call free, or whatever it needs.

    ralloc does not give a crap where the memory came from.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Mon Oct 26 22:20:23 2026
    On Mon, 26 Oct 2026 14:53:48 -0700, Chris M. Thomasson wrote:

    On 10/26/2026 2:45 PM, Lawrence D?Oliveiro wrote:

    On Mon, 26 Oct 2026 13:33:37 -0700, Chris M. Thomasson wrote:

    Say a lib that has foo_create... Well, the damn called must
    remember to call foo_destroy, right?

    Are you backpedalling from your previous idea that the caller must
    allocate the memory for the library to use?

    Where did I say must?

    You said ?Managing the memory is the caller?s job in C anyway.? You
    didn?t say ?could be the caller?s job? as in ?the caller could have a
    choice?, you said ?*is* the caller?s job?. No choice. I.e. the caller
    *must* manage memory.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 15:42:31 2026
    On 10/26/2026 3:20 PM, Lawrence D?Oliveiro wrote:
    On Mon, 26 Oct 2026 14:53:48 -0700, Chris M. Thomasson wrote:

    On 10/26/2026 2:45 PM, Lawrence D?Oliveiro wrote:

    On Mon, 26 Oct 2026 13:33:37 -0700, Chris M. Thomasson wrote:

    Say a lib that has foo_create... Well, the damn called must
    remember to call foo_destroy, right?

    Are you backpedalling from your previous idea that the caller must
    allocate the memory for the library to use?

    Where did I say must?

    You said ?Managing the memory is the caller?s job in C anyway.? You
    didn?t say ?could be the caller?s job? as in ?the caller could have a choice?, you said ?*is* the caller?s job?. No choice. I.e. the caller
    *must* manage memory.

    But, the caller must take care in C. Say a lib that allows the caller to create their own memory from the requirements reaped from the lib. Okay.
    Fine. Also, take a lib that is more "encapsulated" than say a pure foo_create/destroy. The caller must remember to call foo_destroy, right?

    Using io_uring is a fun one. The caller created the memory, iirc from
    mmap, so the kernel can use it. The Kernel punts off the lifetime
    management of the users ring buffers.

    The C must manage things regardless. say malloc and free?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 15:46:04 2026
    On 10/25/2026 8:40 PM, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 19:21:00 -0700, Chris M. Thomasson wrote:

    Managing the memory is the caller?s job in C anyway.

    Does that apply to the caller of library APIs like malloc(3) and
    free(3)?

    you should print that out and frame it.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 16:06:08 2026
    On 10/26/2026 3:20 PM, Lawrence D?Oliveiro wrote:
    On Mon, 26 Oct 2026 14:53:48 -0700, Chris M. Thomasson wrote:

    On 10/26/2026 2:45 PM, Lawrence D?Oliveiro wrote:

    On Mon, 26 Oct 2026 13:33:37 -0700, Chris M. Thomasson wrote:

    Say a lib that has foo_create... Well, the damn called must
    remember to call foo_destroy, right?

    Are you backpedalling from your previous idea that the caller must
    allocate the memory for the library to use?

    Where did I say must?

    You said ?Managing the memory is the caller?s job in C anyway.? You
    didn?t say ?could be the caller?s job? as in ?the caller could have a choice?, you said ?*is* the caller?s job?. No choice. I.e. the caller
    *must* manage memory.

    A simple pattern... Now, some libs can do it others are simply not
    designed that way.


    foo_alloc_req r = foo_query_alloc(&cfg);
    void *mem = aligned_alloc(r.align, r.size); /* once */

    for (int i = 0; i < n_jobs; ++i) {
    foo *f = foo_init(mem, r.size, &cfg); /* build in the same
    block */
    /* ... use f ... */
    foo_deinit(f); /* object ends, block
    stays ours */
    }

    free(mem); /* once, at the very end */

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 19:29:29 2026
    On 10/24/2026 3:43 AM, David Brown wrote:
    On 23/10/2026 18:57, Peter Flass wrote:
    On 10/23/26 02:45, David Brown wrote:
    On 23/10/2026 08:25, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 22:29:45 -0700, Chris M. Thomasson wrote:

    On 10/22/2026 8:19 PM, Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 07:26:21 -0700, Peter Flass wrote:

    That's why I try to use PL/I AUTOMATIC (stack) storage and not
    allocate a lot of stuff. You need to have a disciplined approach >>>>>>> if you allocate random stuff here and there.

    What if you?re building an object that needs to be returned to the >>>>>> caller?

    Have the caller have the object before hand and call a function to
    initialize it?

    I?m assuming that all that BASIC programming hasn?t got to your head,
    and you?re not serious. ;)

    Chris' wording is perhaps poor, but the principle is right.

    I don't know PL/I or Fortran, but in C if you have :

    ˙˙˙˙˙typedef struct data_struct { int a; int xs[20]; } S ;

    ˙˙˙˙˙S build_some_data(void) {
    ˙˙˙˙˙˙˙˙ S s;

    ˙˙˙˙˙˙˙˙ s.a = 123;
    ˙˙˙˙˙˙˙˙ for (int i = 0; i < 20; i++) s.xs[i] = i;

    ˙˙˙˙˙˙˙˙ return s;
    ˙˙˙˙˙}

    ˙˙˙˙˙void foo() {
    ˙˙˙˙˙˙˙˙ S s = build_some_data();
    ˙˙˙˙˙}


    then it is typically handled as though you had written :

    ˙˙˙˙˙void build_some_data(S * p) {
    ˙˙˙˙˙˙˙˙ p->a = 123;
    ˙˙˙˙˙˙˙˙ for (int i = 0; i < 20; i++) p->xs[i] = i;

    ˙˙˙˙˙˙˙˙ return;
    ˙˙˙˙˙}

    ˙˙˙˙˙void foo() {
    ˙˙˙˙˙˙˙˙ S s;
    ˙˙˙˙˙˙˙˙ build_some_data(&s);
    ˙˙˙˙˙}


    That is - the caller creates the /space/ for the returned object, but
    does not do any kind of initialisation.˙ It passes a pointer to that
    space as a hidden parameter to the function that wants to return the
    object.

    That principle should work fine in any language, as long as the size
    of the returned object is known by the caller code.

    That last sentence is why it would not work fine,

    OK.˙ Knowing the size of the returned object is an absolute requirement
    for pre-allocation by the caller, and it is a requirement that is fine
    for a lot of situations and a lot of languages.˙ But if it is not the
    case for PL/I, Fortran, or any other particular language (or particular function in any language), then I fully agree - the object's space can't
    be handled by the caller.


    Use when the API provides it, or else, well, read the api learn and know
    how to use it. If it allows the caller to make the memory it needs, so
    be it, if not, who cares?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 19:57:22 2026
    On 10/24/2026 3:32 PM, Lawrence D?Oliveiro wrote:
    On Sat, 24 Oct 2026 13:27:30 -0700, Chris M. Thomasson wrote:

    Or what about miniaudio?s ma_engine_get_heap_size plus
    ma_engine_init_preallocated

    No idea about that, but the same principle would apply.

    You sound like you never worked with any of it before?????

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 20:09:48 2026
    On 10/24/2026 3:32 PM, Lawrence D?Oliveiro wrote:
    On Sat, 24 Oct 2026 13:27:30 -0700, Chris M. Thomasson wrote:

    Or what about miniaudio?s ma_engine_get_heap_size plus
    ma_engine_init_preallocated

    No idea about that, but the same principle would apply.

    Sure you do, or what are you writing about anyway? Really?

    You seem like the oracle, right?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Dan Cross@3:633/10 to All on Tue Oct 27 10:40:00 2026
    In article <20261027102255.00006052@yahoo.com>,
    Michael S <already5chosen@yahoo.com> wrote:
    On Tue, 27 Oct 2026 09:06:26 +0100
    David Brown <david.brown@hesbynett.no> wrote:
    [snip]
    And there are languages like Erlang that divide everything into
    micro-processes, and use the same mechanisms for controlling and
    passing data around regardless of whether this little processes are
    in the same thread, or different threads, different OS processes, or
    different computers. That works because there are very narrow and
    tightly controlled mechanisms for sharing data.

    Note that these are both languages that run on a VM, not compiled
    languages.

    What you wrote about Erlang resembles MPI, which of course is readily >available for many compiled or jitted languages, including Fortran, C
    and C++.
    I tried to utilize MPI 20 years ago, but the thinking behind it is to >different from mine, so I ran away in horror.

    Erlang uses the "actor" model to represent concurrency; state is
    held by each actor, and actors communicate via message passing,
    potentially changing state in response to messages. This is a
    model for _concurrency_, in which multiple independent threads
    of execution are coordinated to some in a single system.

    One may think of MPI-style systems this way, but there's a
    subtle distinction. The typical use case for something like MPI
    is _parallel_ computation of a numerically intensive problem,
    where "neighbors" nodes need to occasionally share state; this
    is usually about _parallelism_; that is, simultaneity. While a
    concurrency primitive is _necessary_ to think about parallelism
    (and MPI can be used in that fashion), the two are distinct
    concepts that are often conflated. To paraphrase Rob Pike on
    it, concurrency is about dealing with multiple things at once,
    while parallelism is about doing lots of things at the same
    time.

    - Dan C.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From James Kuyper@3:633/10 to All on Tue Oct 27 11:00:08 2026
    On 2026-10-26 17:45, Lawrence D?Oliveiro wrote:
    On Mon, 26 Oct 2026 13:26:38 -0700, Chris M. Thomasson wrote:
    [restore snippage]>> On 2026-10-25 23:39, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 19:11:48 -0700, Chris M. Thomasson wrote:

    A caller provided buffer is normal with a lot of API's out there.

    No it isn?t. It?s not a good way to manage things, anyway: instead of
    solving the resource-allocation problem once and for all in the
    library API, you are pushing the burden onto all the client code, each
    one of which has to solve it for itself.

    That?s a dumb way to design things.

    HUH? How do you call say, fread without a user provided buffer?

    Relevance being?

    fread() uses a caller-provided buffer, which, according to your previous comment, "push[es] the burden onto all the client code, each one of
    which has to solve it for itself", so according to you, "That's a dumb
    way to design things"..If that isn't your actual opinion of fread(),
    your comments need to be at least a little more nuanced to avoid
    applying to fread().

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Scott Lurndal@3:633/10 to All on Tue Oct 27 15:03:45 2026
    cross@spitfire.i.gajendra.net (Dan Cross) writes:
    In article <20261027102255.00006052@yahoo.com>,
    Michael S <already5chosen@yahoo.com> wrote:
    On Tue, 27 Oct 2026 09:06:26 +0100
    David Brown <david.brown@hesbynett.no> wrote:
    [snip]
    And there are languages like Erlang that divide everything into
    micro-processes, and use the same mechanisms for controlling and
    passing data around regardless of whether this little processes are
    in the same thread, or different threads, different OS processes, or
    different computers. That works because there are very narrow and
    tightly controlled mechanisms for sharing data.

    Note that these are both languages that run on a VM, not compiled
    languages.

    What you wrote about Erlang resembles MPI, which of course is readily >>available for many compiled or jitted languages, including Fortran, C
    and C++.
    I tried to utilize MPI 20 years ago, but the thinking behind it is to >>different from mine, so I ran away in horror.

    Erlang uses the "actor" model to represent concurrency; state is
    held by each actor, and actors communicate via message passing,
    potentially changing state in response to messages. This is a
    model for _concurrency_, in which multiple independent threads
    of execution are coordinated to some in a single system.

    Chorus (the microkernel) worked in a similar fashion. The
    microkernel coordinated between actors using message passing.

    The actors implemented the higher level operating system
    functionality. The Amadeus project, for example, implemented
    a version of unix on top of the microkernel using message
    passing between actors (The Object manager handled files and
    filesystems, the Process actor handled the POSIX process
    and thread (SVR4.2ES/MP threads) interfaces including fork,
    and light-weight processes that implemented threads, and
    the Streams actor provide system V streams support and
    networking.

    Unisys released the OS as part of their massively parallel
    OPUS computer system.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Peter Flass@3:633/10 to All on Tue Oct 27 09:41:16 2026
    On 10/27/26 08:00, James Kuyper wrote:
    On 2026-10-26 17:45, Lawrence D?Oliveiro wrote:
    On Mon, 26 Oct 2026 13:26:38 -0700, Chris M. Thomasson wrote:
    [restore snippage]>> On 2026-10-25 23:39, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 19:11:48 -0700, Chris M. Thomasson wrote:

    A caller provided buffer is normal with a lot of API's out there.

    No it isn?t. It?s not a good way to manage things, anyway: instead of
    solving the resource-allocation problem once and for all in the
    library API, you are pushing the burden onto all the client code, each >>>> one of which has to solve it for itself.

    That?s a dumb way to design things.

    HUH? How do you call say, fread without a user provided buffer?

    Relevance being?

    fread() uses a caller-provided buffer, which, according to your previous comment, "push[es] the burden onto all the client code, each one of
    which has to solve it for itself", so according to you, "That's a dumb
    way to design things"..If that isn't your actual opinion of fread(),
    your comments need to be at least a little more nuanced to avoid
    applying to fread().

    The difference is that the size of the buffer for fread() is the maximum
    you want/expect to read. The size of an object is the size it is, not necessarily what you expect. If you don't provide enough space you will truncate.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Scott Lurndal@3:633/10 to All on Tue Oct 27 18:36:48 2026
    Peter Flass <Peter@Iron-Spring.com> writes:
    On 10/27/26 08:00, James Kuyper wrote:
    On 2026-10-26 17:45, Lawrence D?Oliveiro wrote:
    On Mon, 26 Oct 2026 13:26:38 -0700, Chris M. Thomasson wrote:
    [restore snippage]>> On 2026-10-25 23:39, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 19:11:48 -0700, Chris M. Thomasson wrote:

    A caller provided buffer is normal with a lot of API's out there.

    No it isn?t. It?s not a good way to manage things, anyway: instead of >>>>> solving the resource-allocation problem once and for all in the
    library API, you are pushing the burden onto all the client code, each >>>>> one of which has to solve it for itself.

    That?s a dumb way to design things.

    HUH? How do you call say, fread without a user provided buffer?

    Relevance being?

    fread() uses a caller-provided buffer, which, according to your previous
    comment, "push[es] the burden onto all the client code, each one of
    which has to solve it for itself", so according to you, "That's a dumb
    way to design things"..If that isn't your actual opinion of fread(),
    your comments need to be at least a little more nuanced to avoid
    applying to fread().

    The difference is that the size of the buffer for fread() is the maximum
    you want/expect to read. The size of an object is the size it is, not >necessarily what you expect. If you don't provide enough space you will >truncate.

    Which isn't a significant issue with fread, since the underlying stdio
    buffer (or kernel file cache or terminal driver buffer) will hold the
    unread information for the next call to fread.

    fread(3) is basically obsolete for most high-performance applications
    which map the file directly into the process address space (mmap).

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Tue Oct 27 22:22:12 2026
    On Tue, 27 Oct 2026 11:00:08 -0400, James Kuyper wrote:

    On 2026-10-26 17:45, Lawrence D?Oliveiro wrote:

    On Mon, 26 Oct 2026 13:26:38 -0700, Chris M. Thomasson wrote:

    On 2026-10-25 23:39, Lawrence D?Oliveiro wrote:

    On Sun, 25 Oct 2026 19:11:48 -0700, Chris M. Thomasson wrote:

    A caller provided buffer is normal with a lot of API's out there.

    No it isn?t. It?s not a good way to manage things, anyway:
    instead of solving the resource-allocation problem once and for
    all in the library API, you are pushing the burden onto all the
    client code, each one of which has to solve it for itself.

    That?s a dumb way to design things.

    HUH? How do you call say, fread without a user provided buffer?

    Relevance being?

    fread() uses a caller-provided buffer, which, according to your previous comment, "push[es] the burden onto all the client code, each one of
    which has to solve it for itself", so according to you, "That's a dumb
    way to design things"..

    Not even paying attention to what?s being said in the parts you
    quoted, never mind the parts you didn?t. Note my remark above about
    ?solving the resource allocation problem?; elsewhere I asked: ?What if
    you?re building an object that needs to be returned to the caller??

    Not clear yet what we?re talking about here? We?re not talking about
    random API calls, we?re talking about libraries that need to create
    and manage abstract objects that encapsulate the function they are
    providing!

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From James Kuyper@3:633/10 to All on Tue Oct 27 21:35:09 2026
    Thanks to my killfile, I don't see messages posted by Chris M.
    Thomasson, just other people's responses to them.

    On 2026-10-25 20:42, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 16:16:26 -0700, Chris M. Thomasson wrote:

    Even analogous, to say, an API that says read n bytes and store into
    buffer. Well, the caller has lifetime of said buffer. The caller makes
    the buffer, calls into the function.

    So how is the caller supposed to manage that memory?

    That's the oldest message I can find on this sub-thread, and also the
    very last message I can find preceding the one quoted below, and it's
    clearly describing an fread()-like interface, not a function that
    returns objects of sizes unknown to the caller. If the messages I don't
    see gave some other context to this sub-thread, I had no way of knowing
    about it.

    On 2026-10-27 18:22, Lawrence D?Oliveiro wrote:
    On Tue, 27 Oct 2026 11:00:08 -0400, James Kuyper wrote:

    On 2026-10-26 17:45, Lawrence D?Oliveiro wrote:

    On Mon, 26 Oct 2026 13:26:38 -0700, Chris M. Thomasson wrote:

    On 2026-10-25 23:39, Lawrence D?Oliveiro wrote:

    On Sun, 25 Oct 2026 19:11:48 -0700, Chris M. Thomasson wrote:

    A caller provided buffer is normal with a lot of API's out there.

    No it isn?t. It?s not a good way to manage things, anyway:
    instead of solving the resource-allocation problem once and for
    all in the library API, you are pushing the burden onto all the
    client code, each one of which has to solve it for itself.

    That?s a dumb way to design things.

    HUH? How do you call say, fread without a user provided buffer?

    Relevance being?

    fread() uses a caller-provided buffer, which, according to your previous
    comment, "push[es] the burden onto all the client code, each one of
    which has to solve it for itself", so according to you, "That's a dumb
    way to design things"..

    Not even paying attention to what?s being said in the parts you
    quoted, never mind the parts you didn?t. Note my remark above about
    ?solving the resource allocation problem?; elsewhere I asked: ?What if
    you?re building an object that needs to be returned to the caller??

    Yes, and without the context that applies elsewhere, your comment about resource allocation comes off as a non-sequitur.
    Not clear yet what we?re talking about here? We?re not talking about
    random API calls, we?re talking about libraries that need to create
    and manage abstract objects that encapsulate the function they are
    providing!

    I can find no mention of that topic anywhere on this sub-thread. It
    might be in the parts of Chris's messages that I didn't see and you
    didn't quote.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Wed Oct 28 01:43:55 2026
    On Tue, 27 Oct 2026 21:35:09 -0400, James Kuyper wrote:

    ... without the context that applies elsewhere, your comment about
    resource allocation comes off as a non-sequitur.

    That?s just an excuse. Other comments of mine, from further back in
    this particular line of this thread:

    * ?What if you?re building an object that needs to be returned to the
    caller??
    * ?The principle applies to Fortran as it does to any language where
    you have to explicitly manage storage allocations.?
    * ?If you have to do cleanup at each level before exiting, then it works
    perfectly well.?

    Did you notice any of that?

    From elsewhere in the discussion:

    I find the C code I write tends to do a lot of dynamic resource
    allocations. These can sometimes fail with errors. So error
    recovery will invariably involve cleaning up those parts of the
    allocations which already succeeded. Gotos are no good for this;
    you need to exit levels of structure nesting one by one, disposing
    of allocations as you go.

    I put together an example here
    <https://gitlab.com/ldo/a_structured_discipline_of_programming>.
    This is an extension module that offers services to Python code,
    because that is just about the worst example I could think of, for
    those who think gotos can cut it.

    Did you pay attention to any of that?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From James Kuyper@3:633/10 to All on Tue Oct 27 22:18:54 2026
    On 2026-10-27 21:43, Lawrence D?Oliveiro wrote:
    On Tue, 27 Oct 2026 21:35:09 -0400, James Kuyper wrote:

    ... without the context that applies elsewhere, your comment about
    resource allocation comes off as a non-sequitur.

    That?s just an excuse. Other comments of mine, from further back in
    this particular line of this thread:

    * ?What if you?re building an object that needs to be returned to the
    caller??
    * ?The principle applies to Fortran as it does to any language where
    you have to explicitly manage storage allocations.?
    * ?If you have to do cleanup at each level before exiting, then it works
    perfectly well.?

    Did you notice any of that?
    No, none of those comments appear anywhere in this sub-thread as
    displayed by Thunderbird. How do they fit in to the sequence of messages
    that lead to this one? If they appeared in some other sub-thread, that's
    not relevant; the fact that something is being discussed in another
    sub-thread doesn't make it relevant to what's being discussed in this
    one. However, if those comments occur in Chris' text that I never saw,
    or in messages on this sub-thread that are prior to the earliest one I
    quoted, then they would be relevant.
    The references for the oldest message I quoted indicate that there were
    20 previous ones in that sub-thread, but they don't display as
    predecessors of that message. This is a common problem when I filter out
    all the messages posted by someone. If that person is a significant
    contributor to a particular thread, that thread gets chopped up into
    pieces and Thunderbird fails to notice that those pieces are related to
    each other.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Peter Flass@3:633/10 to All on Tue Oct 27 19:28:47 2026
    On 10/27/26 18:43, Lawrence D?Oliveiro wrote:
    On Tue, 27 Oct 2026 21:35:09 -0400, James Kuyper wrote:

    ... without the context that applies elsewhere, your comment about
    resource allocation comes off as a non-sequitur.

    That?s just an excuse. Other comments of mine, from further back in
    this particular line of this thread:

    * ?What if you?re building an object that needs to be returned to the
    caller??
    * ?The principle applies to Fortran as it does to any language where
    you have to explicitly manage storage allocations.?
    * ?If you have to do cleanup at each level before exiting, then it works
    perfectly well.?

    Did you notice any of that?

    From elsewhere in the discussion:

    I find the C code I write tends to do a lot of dynamic resource
    allocations. These can sometimes fail with errors. So error
    recovery will invariably involve cleaning up those parts of the
    allocations which already succeeded. Gotos are no good for this;
    you need to exit levels of structure nesting one by one, disposing
    of allocations as you go.

    I put together an example here
    <https://gitlab.com/ldo/a_structured_discipline_of_programming>.
    This is an extension module that offers services to Python code,
    because that is just about the worst example I could think of, for
    those who think gotos can cut it.

    Did you pay attention to any of that?

    You could keep track of the allocations in a list (or whatever) and then
    walk thru and clean them up at once.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Wed Oct 28 14:16:43 2026
    On 10/27/2026 6:43 PM, Lawrence D?Oliveiro wrote:
    On Tue, 27 Oct 2026 21:35:09 -0400, James Kuyper wrote:

    ... without the context that applies elsewhere, your comment about
    resource allocation comes off as a non-sequitur.

    That?s just an excuse. Other comments of mine, from further back in
    this particular line of this thread:

    * ?What if you?re building an object that needs to be returned to the
    caller??
    * ?The principle applies to Fortran as it does to any language where
    you have to explicitly manage storage allocations.?
    * ?If you have to do cleanup at each level before exiting, then it works
    perfectly well.?

    Did you notice any of that?

    From elsewhere in the discussion:

    I find the C code I write tends to do a lot of dynamic resource
    allocations. These can sometimes fail with errors. So error
    recovery will invariably involve cleaning up those parts of the
    allocations which already succeeded. Gotos are no good for this;
    you need to exit levels of structure nesting one by one, disposing
    of allocations as you go.

    I put together an example here
    <https://gitlab.com/ldo/a_structured_discipline_of_programming>.
    This is an extension module that offers services to Python code,
    because that is just about the worst example I could think of, for
    those who think gotos can cut it.

    Did you pay attention to any of that?

    Its actually pretty simple. There are libs out there that allow the
    caller to create the memory it needs. io_uring is just one of them.

    DirectX12 is another. The user creates all the memory, aligns it, etc,
    and can update a single frame with a single memcpy.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From John Smith@3:633/10 to All on Fri Oct 30 05:04:30 2026
    On 14/10/2026 05:18, Lynn McGuire wrote:
    ?The end of software secrecy is almost upon us. The death of closed
    source, and the final triumph of open source. ? -Eric S. Raymond.


    What's the situation re C++ 26?

    <https://elsolitario.org/en/2026/10/26/according-to-seacord-cpp26-fails-dis-ballot-12-of-20/>

    Any progress?





    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From boltar@3:633/10 to All on Sat Oct 31 09:45:04 2026
    On Fri, 30 Oct 2026 22:35:05 -0000 (UTC)
    Lawrence =?iso-8859-13?q?D=FFOliveiro?= <ldo@nz.invalid> gabbled:
    The trend nowadays is to revive the old coroutine concept, in a new
    guise called ?stackless? coroutines. These give you support for async >operations, but with transfers of control being made explicit at
    ?await? points, rather than unpredictably as with full preemptive
    threading. This greatly reduces the opportunity for race conditions.

    Coroutines are just a complicated way to re-implement a function with a load
    of statics.

    eg:

    void myfunc()
    {
    static int i = 0;
    for(;;++i)
    {
    [do something based on value of i]
    [return when some condition met]
    }
    }

    Also the C++ implementation is so bad its unusable.

    Credit to Microsoft for pioneering this, but nowadays you see the idea >popping up in JavaScript and Python and who knows where else.

    Python nailed it - you just call "yield", job done.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From boltar@3:633/10 to All on Sat Oct 31 09:47:42 2026
    On Sat, 31 Oct 2026 05:37:23 -0000 (UTC)
    Lawrence =?iso-8859-13?q?D=FFOliveiro?= <ldo@nz.invalid> gabbled:
    Here?s a fun little thing: if you set a socket to nonblocking and then
    do the connect(2) call, it will seemingly fail with an EINPROGRESS
    error. But in fact, the connection attempt gets initiated, and you can >monitor its subsequent progress from your event loop.

    Far too many devs don't know about or don't understand multiplexing using select() or poll(). Admittedly these are borked on Windows as you can't
    use sockets with them which is their main raison d'etre, but on unix they're a very powerful tool. For simple servers with a low workload they can allow single threaded development simplifying the code immensely.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael S@3:633/10 to All on Sat Oct 31 19:56:10 2026
    On Sat, 31 Oct 2026 09:47:42 -0000 (UTC)
    boltar@caprica.universe wrote:

    On Sat, 31 Oct 2026 05:37:23 -0000 (UTC)
    Lawrence =?iso-8859-13?q?D=FFOliveiro?= <ldo@nz.invalid> gabbled:
    Here?s a fun little thing: if you set a socket to nonblocking and
    then do the connect(2) call, it will seemingly fail with an
    EINPROGRESS error. But in fact, the connection attempt gets
    initiated, and you can monitor its subsequent progress from your
    event loop.

    Far too many devs don't know about or don't understand multiplexing
    using select() or poll(). Admittedly these are borked on Windows as
    you can't use sockets with them

    On what planet?

    which is their main raison d'etre,
    but on unix they're a very powerful tool. For simple servers with a
    low workload they can allow single threaded development simplifying
    the code immensely.




    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From boltar@3:633/10 to All on Sun Nov 1 08:32:42 2026
    On Sat, 31 Oct 2026 19:56:10 +0200
    Michael S <already5chosen@yahoo.com> gabbled:
    On Sat, 31 Oct 2026 09:47:42 -0000 (UTC)
    boltar@caprica.universe wrote:

    On Sat, 31 Oct 2026 05:37:23 -0000 (UTC)
    Lawrence =3D?iso-8859-13?q?D=3DFFOliveiro?=3D <ldo@nz.invalid> gabbled:
    Here=E2=80=99s a fun little thing: if you set a socket to nonblocking and >> >then do the connect(2) call, it will seemingly fail with an
    EINPROGRESS error. But in fact, the connection attempt gets
    initiated, and you can monitor its subsequent progress from your
    event loop. =20
    =20
    Far too many devs don't know about or don't understand multiplexing
    using select() or poll(). Admittedly these are borked on Windows as
    you can't use sockets with them=20

    On what planet?

    On this one where you see code that is only multithreaded in order to serve individual sockets, not because it needs to be.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael S@3:633/10 to All on Sun Nov 1 21:59:41 2026
    On Sun, 1 Nov 2026 08:32:42 -0000 (UTC)
    boltar@caprica.universe wrote:

    On Sat, 31 Oct 2026 19:56:10 +0200
    Michael S <already5chosen@yahoo.com> gabbled:
    On Sat, 31 Oct 2026 09:47:42 -0000 (UTC)
    boltar@caprica.universe wrote:

    On Sat, 31 Oct 2026 05:37:23 -0000 (UTC)
    Lawrence =3D?iso-8859-13?q?D=3DFFOliveiro?=3D <ldo@nz.invalid>
    gabbled:
    Here=E2=80=99s a fun little thing: if you set a socket to
    nonblocking and then do the connect(2) call, it will seemingly
    fail with an EINPROGRESS error. But in fact, the connection
    attempt gets initiated, and you can monitor its subsequent
    progress from your event loop. =20
    =20
    Far too many devs don't know about or don't understand multiplexing
    using select() or poll(). Admittedly these are borked on Windows as
    you can't use sockets with them=20

    On what planet?

    On this one where you see code that is only multithreaded in order to
    serve individual sockets, not because it needs to be.


    That's because many people unable to implement state machines. Or able,
    but don't like them.
    It has nothing to do with availability and functionality of select/poll
    on Windows.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Bonita Montero@3:633/10 to All on Mon Nov 2 10:30:34 2026
    Am 14.10.2026 um 06:18 schrieb Lynn McGuire:
    ?The end of software secrecy is almost upon us. The death of closed
    source, and the final triumph of open source. ? -Eric S. Raymond.
    ˙˙ https://www.battleswarmblog.com/?p=73639

    "I should have realized this a few months ago when I successfully
    decompiled the game of Firefighter from an ancient DOS shareware binary.
    My robot friend was able to tell it had been written in Borland Pascal
    from looking at the data layout; it gave me back very readable Pascal
    code with sensibly chosen function and variable names. I transpiled it
    to Rust and now ship it as part of my heritage games collection."

    Huh, so somebody has actually built a decent decompiler.˙ Why do I doubt this even though ESR says otherwise?

    And he has a translator from Borland Pascal to Rust?
    I have provided Claude Code with snippets of code?roughly a screen's
    worth in length?on several occasions. At times, it flagged errors that
    weren't actually errors at all.
    It is quite possible that AI has reached a point where it can
    effectively translate small blocks of assembly code into high-level
    programming languages. However, based on my own experience with high-
    level code, I am skeptical that this would work well for larger, more
    complex applications.
    There are already AI-assisted tools for converting COBOL to Java, but
    even then, a developer must review the entire codebase afterward, as
    the conversion is never 100% accurate.
    Given this, I consider it unlikely that the process will perform any
    better in the long run.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From boltar@3:633/10 to All on Mon Nov 2 15:43:42 2026
    On Sun, 1 Nov 2026 21:59:41 +0200
    Michael S <already5chosen@yahoo.com> gabbled:
    On Sun, 1 Nov 2026 08:32:42 -0000 (UTC)
    boltar@caprica.universe wrote:
    On this one where you see code that is only multithreaded in order to
    serve individual sockets, not because it needs to be.


    That's because many people unable to implement state machines. Or able,
    but don't like them.
    It has nothing to do with availability and functionality of select/poll
    on Windows.

    Last time I had the misfortune to use win32 it couldn't multiplex on sockets.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Charlie Gibbs@3:633/10 to All on Mon Nov 2 16:51:47 2026
    On 2026-11-02, boltar@caprica.universe <boltar@caprica.universe> wrote:

    On Sun, 1 Nov 2026 21:59:41 +0200

    Michael S <already5chosen@yahoo.com> gabbled:

    On Sun, 1 Nov 2026 08:32:42 -0000 (UTC)
    boltar@caprica.universe wrote:

    On this one where you see code that is only multithreaded in order to
    serve individual sockets, not because it needs to be.

    That's because many people unable to implement state machines. Or able,
    but don't like them.
    It has nothing to do with availability and functionality of select/poll
    on Windows.

    Last time I had the misfortune to use win32 it couldn't multiplex on sockets.

    By "multiplex on sockets" do you mean supporting more then one connection
    on a single socket? Serious question here: could you tell me how this can
    be useful?

    My Win32 code does accept multiple incoming connections on the same
    port number, but each one gets its own socket. And to get back on
    thread (ahem), it uses a single thread with nonblocking sockets.

    --
    /~\ Charlie Gibbs | In this world there are
    \ / <cgibbs@kltpzyxm.invalid> | two kinds of people:
    X I'm really at ac.dekanfrus | 1. Those who can extrapolate
    / \ if you read it the right way. | from incomplete data.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael S@3:633/10 to All on Mon Nov 2 23:46:58 2026
    On Mon, 2 Nov 2026 15:43:42 -0000 (UTC)
    boltar@caprica.universe wrote:

    On Sun, 1 Nov 2026 21:59:41 +0200
    Michael S <already5chosen@yahoo.com> gabbled:
    On Sun, 1 Nov 2026 08:32:42 -0000 (UTC)
    boltar@caprica.universe wrote:
    On this one where you see code that is only multithreaded in order
    to serve individual sockets, not because it needs to be.


    That's because many people unable to implement state machines. Or
    able, but don't like them.
    It has nothing to do with availability and functionality of
    select/poll on Windows.

    Last time I had the misfortune to use win32 it couldn't multiplex on
    sockets.


    That's nonsense. That part of Winsock2 API did not change since 1993.
    That is, in early 2000s they added poll() (WAASAPoll), but select() is
    the same BSD select() from the very beginning, just a little easier to
    use than original, because nfds is DNC.
    Now, if you woulds say that on Winsock2 select() can't multiplex
    waiting for socket I/O with waiting for other sorts of I/O (files and
    pipes) then your statement would make more sense*.
    But it does not sound like you really want to make sense. You strongly
    prefer mindless bashing.

    ----
    * - Although,
    1) of course, there (in Win32) exist not too complicated alternative
    methods to achieve such multiplexing as well. Just not via select().
    2) today, with nearly all file I/O deeply cached, multiplexing waiting
    for file I/O with waiting for sockets is a bad idea. OTOH, Multiplexing
    sockets with pipes could still make sense, infrequently.



    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Nov 2 14:59:26 2026
    On 11/1/2026 1:32 AM, boltar@caprica.universe wrote:
    On Sat, 31 Oct 2026 19:56:10 +0200
    Michael S <already5chosen@yahoo.com> gabbled:
    On Sat, 31 Oct 2026 09:47:42 -0000 (UTC)
    boltar@caprica.universe wrote:

    On Sat, 31 Oct 2026 05:37:23 -0000 (UTC)
    Lawrence =3D?iso-8859-13?q?D=3DFFOliveiro?=3D <ldo@nz.invalid> gabbled: >>>> Here=E2=80=99s a fun little thing: if you set a socket to nonblocking and >>>> then do the connect(2) call, it will seemingly fail with an
    EINPROGRESS error. But in fact, the connection attempt gets
    initiated, and you can monitor its subsequent progress from your
    event loop. =20
    =20
    Far too many devs don't know about or don't understand multiplexing
    using select() or poll(). Admittedly these are borked on Windows as
    you can't use sockets with them=20

    On what planet?

    On this one where you see code that is only multithreaded in order to serve individual sockets, not because it needs to be.


    Either you are trolling or don't have a clue?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Nov 2 15:00:03 2026
    On 11/2/2026 7:43 AM, boltar@caprica.universe wrote:
    On Sun, 1 Nov 2026 21:59:41 +0200
    Michael S <already5chosen@yahoo.com> gabbled:
    On Sun, 1 Nov 2026 08:32:42 -0000 (UTC)
    boltar@caprica.universe wrote:
    On this one where you see code that is only multithreaded in order to
    serve individual sockets, not because it needs to be.


    That's because many people unable to implement state machines. Or able,
    but don't like them.
    It has nothing to do with availability and functionality of select/poll
    on Windows.

    Last time I had the misfortune to use win32 it couldn't multiplex on sockets.


    Ever use Nt say 4.0? IOCP?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Nov 2 15:02:44 2026
    On 11/2/2026 1:46 PM, Michael S wrote:
    On Mon, 2 Nov 2026 15:43:42 -0000 (UTC)
    boltar@caprica.universe wrote:

    On Sun, 1 Nov 2026 21:59:41 +0200
    Michael S <already5chosen@yahoo.com> gabbled:
    On Sun, 1 Nov 2026 08:32:42 -0000 (UTC)
    boltar@caprica.universe wrote:
    On this one where you see code that is only multithreaded in order
    to serve individual sockets, not because it needs to be.


    That's because many people unable to implement state machines. Or
    able, but don't like them.
    It has nothing to do with availability and functionality of
    select/poll on Windows.

    Last time I had the misfortune to use win32 it couldn't multiplex on
    sockets.


    That's nonsense. That part of Winsock2 API did not change since 1993.
    That is, in early 2000s they added poll() (WAASAPoll), but select() is
    the same BSD select() from the very beginning, just a little easier to
    use than original, because nfds is DNC.
    Now, if you woulds say that on Winsock2 select() can't multiplex
    waiting for socket I/O with waiting for other sorts of I/O (files and
    pipes) then your statement would make more sense*.
    But it does not sound like you really want to make sense. You strongly
    prefer mindless bashing.

    ----
    * - Although,
    1) of course, there (in Win32) exist not too complicated alternative
    methods to achieve such multiplexing as well. Just not via select().
    2) today, with nearly all file I/O deeply cached, multiplexing waiting
    for file I/O with waiting for sockets is a bad idea. OTOH, Multiplexing sockets with pipes could still make sense, infrequently.



    Well, before IOCP we would need to use WaitForMultipleObjects, iirc. But
    there was a trick we had to use. We had to alter the indices! Shift
    them, or even randomize them.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Nov 2 15:03:44 2026
    On 11/2/2026 1:46 PM, Michael S wrote:
    On Mon, 2 Nov 2026 15:43:42 -0000 (UTC)
    boltar@caprica.universe wrote:

    On Sun, 1 Nov 2026 21:59:41 +0200
    Michael S <already5chosen@yahoo.com> gabbled:
    On Sun, 1 Nov 2026 08:32:42 -0000 (UTC)
    boltar@caprica.universe wrote:
    On this one where you see code that is only multithreaded in order
    to serve individual sockets, not because it needs to be.


    That's because many people unable to implement state machines. Or
    able, but don't like them.
    It has nothing to do with availability and functionality of
    select/poll on Windows.

    Last time I had the misfortune to use win32 it couldn't multiplex on
    sockets.


    That's nonsense. That part of Winsock2 API did not change since 1993.
    That is, in early 2000s they added poll() (WAASAPoll), but select() is
    the same BSD select() from the very beginning, just a little easier to
    use than original, because nfds is DNC.
    Now, if you woulds say that on Winsock2 select() can't multiplex
    waiting for socket I/O with waiting for other sorts of I/O (files and
    pipes) then your statement would make more sense*.
    But it does not sound like you really want to make sense. You strongly
    prefer mindless bashing.

    ----
    * - Although,
    1) of course, there (in Win32) exist not too complicated alternative
    methods to achieve such multiplexing as well. Just not via select().
    2) today, with nearly all file I/O deeply cached, multiplexing waiting
    for file I/O with waiting for sockets is a bad idea. OTOH, Multiplexing sockets with pipes could still make sense, infrequently.



    Have you ever used IOCP on windows?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael S@3:633/10 to All on Tue Nov 3 21:51:42 2026
    On Mon, 2 Nov 2026 15:03:44 -0800
    "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> wrote:

    On 11/2/2026 1:46 PM, Michael S wrote:
    On Mon, 2 Nov 2026 15:43:42 -0000 (UTC)
    boltar@caprica.universe wrote:

    On Sun, 1 Nov 2026 21:59:41 +0200
    Michael S <already5chosen@yahoo.com> gabbled:
    On Sun, 1 Nov 2026 08:32:42 -0000 (UTC)
    boltar@caprica.universe wrote:
    On this one where you see code that is only multithreaded in
    order to serve individual sockets, not because it needs to be.


    That's because many people unable to implement state machines. Or
    able, but don't like them.
    It has nothing to do with availability and functionality of
    select/poll on Windows.

    Last time I had the misfortune to use win32 it couldn't multiplex
    on sockets.


    That's nonsense. That part of Winsock2 API did not change since
    1993. That is, in early 2000s they added poll() (WAASAPoll), but
    select() is the same BSD select() from the very beginning, just a
    little easier to use than original, because nfds is DNC.
    Now, if you woulds say that on Winsock2 select() can't multiplex
    waiting for socket I/O with waiting for other sorts of I/O (files
    and pipes) then your statement would make more sense*.
    But it does not sound like you really want to make sense. You
    strongly prefer mindless bashing.

    ----
    * - Although,
    1) of course, there (in Win32) exist not too complicated alternative methods to achieve such multiplexing as well. Just not via select().
    2) today, with nearly all file I/O deeply cached, multiplexing
    waiting for file I/O with waiting for sockets is a bad idea. OTOH, Multiplexing sockets with pipes could still make sense,
    infrequently.



    Have you ever used IOCP on windows?

    No, I didn't.
    IMHO, IO compleiion ports "solve" problems that do not exist today
    and mostly did not exist since 15-20 years ago.



    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Tue Nov 3 13:10:09 2026
    On 11/3/2026 11:51 AM, Michael S wrote:
    On Mon, 2 Nov 2026 15:03:44 -0800
    "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> wrote:

    On 11/2/2026 1:46 PM, Michael S wrote:
    On Mon, 2 Nov 2026 15:43:42 -0000 (UTC)
    boltar@caprica.universe wrote:

    On Sun, 1 Nov 2026 21:59:41 +0200
    Michael S <already5chosen@yahoo.com> gabbled:
    On Sun, 1 Nov 2026 08:32:42 -0000 (UTC)
    boltar@caprica.universe wrote:
    On this one where you see code that is only multithreaded in
    order to serve individual sockets, not because it needs to be.


    That's because many people unable to implement state machines. Or
    able, but don't like them.
    It has nothing to do with availability and functionality of
    select/poll on Windows.

    Last time I had the misfortune to use win32 it couldn't multiplex
    on sockets.


    That's nonsense. That part of Winsock2 API did not change since
    1993. That is, in early 2000s they added poll() (WAASAPoll), but
    select() is the same BSD select() from the very beginning, just a
    little easier to use than original, because nfds is DNC.
    Now, if you woulds say that on Winsock2 select() can't multiplex
    waiting for socket I/O with waiting for other sorts of I/O (files
    and pipes) then your statement would make more sense*.
    But it does not sound like you really want to make sense. You
    strongly prefer mindless bashing.

    ----
    * - Although,
    1) of course, there (in Win32) exist not too complicated alternative
    methods to achieve such multiplexing as well. Just not via select().
    2) today, with nearly all file I/O deeply cached, multiplexing
    waiting for file I/O with waiting for sockets is a bad idea. OTOH,
    Multiplexing sockets with pipes could still make sense,
    infrequently.



    Have you ever used IOCP on windows?

    No, I didn't.
    IMHO, IO compleiion ports "solve" problems that do not exist today
    and mostly did not exist since 15-20 years ago.


    Are you suggesting that IOCP is useless? What about AIO or io_uring? AIO
    is basically IOCP anyway. io_uring is special, but still uses a
    "completion" setup.



    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From boltar@3:633/10 to All on Wed Nov 4 08:48:49 2026
    On Mon, 02 Nov 2026 16:51:47 GMT
    Charlie Gibbs <cgibbs@kltpzyxm.invalid> gabbled:
    On 2026-11-02, boltar@caprica.universe <boltar@caprica.universe> wrote:

    On Sun, 1 Nov 2026 21:59:41 +0200

    Michael S <already5chosen@yahoo.com> gabbled:

    On Sun, 1 Nov 2026 08:32:42 -0000 (UTC)
    boltar@caprica.universe wrote:

    On this one where you see code that is only multithreaded in order to
    serve individual sockets, not because it needs to be.

    That's because many people unable to implement state machines. Or able,
    but don't like them.
    It has nothing to do with availability and functionality of select/poll
    on Windows.

    Last time I had the misfortune to use win32 it couldn't multiplex on sockets.


    By "multiplex on sockets" do you mean supporting more then one connection
    on a single socket? Serious question here: could you tell me how this can
    be useful?

    No I don't mean that and I can't be bother explaining what multiplexing means to someone who's clearly never used it.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From boltar@3:633/10 to All on Wed Nov 4 08:54:20 2026
    On Mon, 2 Nov 2026 23:46:58 +0200
    Michael S <already5chosen@yahoo.com> gabbled:
    On Mon, 2 Nov 2026 15:43:42 -0000 (UTC)
    boltar@caprica.universe wrote:
    Last time I had the misfortune to use win32 it couldn't multiplex on
    sockets.


    That's nonsense. That part of Winsock2 API did not change since 1993.
    That is, in early 2000s they added poll() (WAASAPoll), but select() is
    the same BSD select() from the very beginning, just a little easier to
    use than original, because nfds is DNC.
    Now, if you woulds say that on Winsock2 select() can't multiplex
    waiting for socket I/O with waiting for other sorts of I/O (files and
    pipes) then your statement would make more sense*.

    Yes, for some bizarre reason MS implemented the userspace sockets as some
    kind of handle instead of an integer file descriptor like every other sockets library.

    2) today, with nearly all file I/O deeply cached, multiplexing waiting
    for file I/O with waiting for sockets is a bad idea. OTOH, Multiplexing >sockets with pipes could still make sense, infrequently.

    Depends on the use case.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From boltar@3:633/10 to All on Wed Nov 4 08:54:51 2026
    On Mon, 2 Nov 2026 14:59:26 -0800
    "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled:
    On 11/1/2026 1:32 AM, boltar@caprica.universe wrote:
    On Sat, 31 Oct 2026 19:56:10 +0200
    Michael S <already5chosen@yahoo.com> gabbled:
    On Sat, 31 Oct 2026 09:47:42 -0000 (UTC)
    boltar@caprica.universe wrote:

    On Sat, 31 Oct 2026 05:37:23 -0000 (UTC)
    Lawrence =3D?iso-8859-13?q?D=3DFFOliveiro?=3D <ldo@nz.invalid> gabbled: >>>>> Here=E2=80=99s a fun little thing: if you set a socket to nonblocking and >>>>> then do the connect(2) call, it will seemingly fail with an
    EINPROGRESS error. But in fact, the connection attempt gets
    initiated, and you can monitor its subsequent progress from your
    event loop. =20
    =20
    Far too many devs don't know about or don't understand multiplexing
    using select() or poll(). Admittedly these are borked on Windows as
    you can't use sockets with them=20

    On what planet?

    On this one where you see code that is only multithreaded in order to serve >> individual sockets, not because it needs to be.


    Either you are trolling or don't have a clue?

    Seems to be your standard response to anyone you disagree with. Go back under your bridge.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Wed Nov 4 02:22:52 2026
    On 11/4/2026 12:54 AM, boltar@caprica.universe wrote:
    On Mon, 2 Nov 2026 14:59:26 -0800
    "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled:
    On 11/1/2026 1:32 AM, boltar@caprica.universe wrote:
    On Sat, 31 Oct 2026 19:56:10 +0200
    Michael S <already5chosen@yahoo.com> gabbled:
    On Sat, 31 Oct 2026 09:47:42 -0000 (UTC)
    boltar@caprica.universe wrote:

    On Sat, 31 Oct 2026 05:37:23 -0000 (UTC)
    Lawrence =3D?iso-8859-13?q?D=3DFFOliveiro?=3D <ldo@nz.invalid>
    gabbled:
    Here=E2=80=99s a fun little thing: if you set a socket to
    nonblocking and
    then do the connect(2) call, it will seemingly fail with an
    EINPROGRESS error. But in fact, the connection attempt gets
    initiated, and you can monitor its subsequent progress from your
    event loop. =20
    =20
    Far too many devs don't know about or don't understand multiplexing
    using select() or poll(). Admittedly these are borked on Windows as
    you can't use sockets with them=20

    On what planet?

    On this one where you see code that is only multithreaded in order to
    serve
    individual sockets, not because it needs to be.


    Either you are trolling or don't have a clue?

    Seems to be your standard response to anyone you disagree with. Go back under
    your bridge.


    Really? Why do you have a hatred for say, IOCP? If so, you must also
    HATE AIO, or io_uring?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Wed Nov 4 02:24:07 2026
    On 11/4/2026 12:54 AM, boltar@caprica.universe wrote:
    On Mon, 2 Nov 2026 14:59:26 -0800
    "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled:
    On 11/1/2026 1:32 AM, boltar@caprica.universe wrote:
    On Sat, 31 Oct 2026 19:56:10 +0200
    Michael S <already5chosen@yahoo.com> gabbled:
    On Sat, 31 Oct 2026 09:47:42 -0000 (UTC)
    boltar@caprica.universe wrote:

    On Sat, 31 Oct 2026 05:37:23 -0000 (UTC)
    Lawrence =3D?iso-8859-13?q?D=3DFFOliveiro?=3D <ldo@nz.invalid>
    gabbled:
    Here=E2=80=99s a fun little thing: if you set a socket to
    nonblocking and
    then do the connect(2) call, it will seemingly fail with an
    EINPROGRESS error. But in fact, the connection attempt gets
    initiated, and you can monitor its subsequent progress from your
    event loop. =20
    =20
    Far too many devs don't know about or don't understand multiplexing
    using select() or poll(). Admittedly these are borked on Windows as
    you can't use sockets with them=20

    On what planet?

    On this one where you see code that is only multithreaded in order to
    serve
    individual sockets, not because it needs to be.


    Either you are trolling or don't have a clue?

    Seems to be your standard response to anyone you disagree with. Go back under
    your bridge.


    Before you listen to this, be sure to not in a mood to get really pissed
    off:

    https://youtu.be/mrKKBBUQnYg

    ;^) too late. Your fate of windows is misguided. It has some fun things.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Jeroen Belleman@3:633/10 to All on Wed Nov 4 11:24:54 2026
    On 11/4/26 09:48, boltar@caprica.universe wrote:
    On Mon, 02 Nov 2026 16:51:47 GMT
    Charlie Gibbs <cgibbs@kltpzyxm.invalid> gabbled:
    On 2026-11-02, boltar@caprica.universe <boltar@caprica.universe> wrote:

    On Sun, 1 Nov 2026 21:59:41 +0200

    Michael S <already5chosen@yahoo.com> gabbled:

    On Sun, 1 Nov 2026 08:32:42 -0000 (UTC)
    boltar@caprica.universe wrote:

    On this one where you see code that is only multithreaded in order to >>>>> serve individual sockets, not because it needs to be.

    That's because many people unable to implement state machines. Or able, >>>> but don't like them.
    It has nothing to do with availability and functionality of select/poll >>>> on Windows.

    Last time I had the misfortune to use win32 it couldn't multiplex on sockets.


    By "multiplex on sockets" do you mean supporting more then one connection
    on a single socket? Serious question here: could you tell me how this can >> be useful?

    No I don't mean that and I can't be bother explaining what multiplexing means to someone who's clearly never used it.


    Don't be so smug. You could at least give him a hint.
    If you bother enough to reply, you might as well show
    that you know.

    Like, search for "unix select", or something?

    Jeroen Belleman

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Wed Nov 4 02:34:52 2026
    On 10/27/2026 8:03 AM, Scott Lurndal wrote:
    cross@spitfire.i.gajendra.net (Dan Cross) writes:
    In article <20261027102255.00006052@yahoo.com>,
    Michael S <already5chosen@yahoo.com> wrote:
    On Tue, 27 Oct 2026 09:06:26 +0100
    David Brown <david.brown@hesbynett.no> wrote:
    [snip]
    And there are languages like Erlang that divide everything into
    micro-processes, and use the same mechanisms for controlling and
    passing data around regardless of whether this little processes are
    in the same thread, or different threads, different OS processes, or
    different computers. That works because there are very narrow and
    tightly controlled mechanisms for sharing data.

    Note that these are both languages that run on a VM, not compiled
    languages.

    What you wrote about Erlang resembles MPI, which of course is readily
    available for many compiled or jitted languages, including Fortran, C
    and C++.
    I tried to utilize MPI 20 years ago, but the thinking behind it is to
    different from mine, so I ran away in horror.

    Erlang uses the "actor" model to represent concurrency; state is
    held by each actor, and actors communicate via message passing,
    potentially changing state in response to messages. This is a
    model for _concurrency_, in which multiple independent threads
    of execution are coordinated to some in a single system.

    Chorus (the microkernel) worked in a similar fashion. The
    microkernel coordinated between actors using message passing.

    The actors implemented the higher level operating system
    functionality. The Amadeus project, for example, implemented
    a version of unix on top of the microkernel using message
    passing between actors (The Object manager handled files and
    filesystems, the Process actor handled the POSIX process
    and thread (SVR4.2ES/MP threads) interfaces including fork,
    and light-weight processes that implemented threads, and
    the Streams actor provide system V streams support and
    networking.

    Unisys released the OS as part of their massively parallel
    OPUS computer system.

    There are many ways to handle proper sync in multiprocess systems. Indeed.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Wed Nov 4 02:48:17 2026
    On 10/27/2026 11:36 AM, Scott Lurndal wrote:
    Peter Flass <Peter@Iron-Spring.com> writes:
    On 10/27/26 08:00, James Kuyper wrote:
    On 2026-10-26 17:45, Lawrence D?Oliveiro wrote:
    On Mon, 26 Oct 2026 13:26:38 -0700, Chris M. Thomasson wrote:
    [restore snippage]>> On 2026-10-25 23:39, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 19:11:48 -0700, Chris M. Thomasson wrote:

    A caller provided buffer is normal with a lot of API's out there. >>>>>>
    No it isn?t. It?s not a good way to manage things, anyway: instead of >>>>>> solving the resource-allocation problem once and for all in the
    library API, you are pushing the burden onto all the client code, each >>>>>> one of which has to solve it for itself.

    That?s a dumb way to design things.

    HUH? How do you call say, fread without a user provided buffer?

    Relevance being?

    fread() uses a caller-provided buffer, which, according to your previous >>> comment, "push[es] the burden onto all the client code, each one of
    which has to solve it for itself", so according to you, "That's a dumb
    way to design things"..If that isn't your actual opinion of fread(),
    your comments need to be at least a little more nuanced to avoid
    applying to fread().

    The difference is that the size of the buffer for fread() is the maximum
    you want/expect to read. The size of an object is the size it is, not
    necessarily what you expect. If you don't provide enough space you will
    truncate.

    Which isn't a significant issue with fread, since the underlying stdio
    buffer (or kernel file cache or terminal driver buffer) will hold the
    unread information for the next call to fread.

    fread(3) is basically obsolete for most high-performance applications
    which map the file directly into the process address space (mmap).

    Ditto.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From boltar@3:633/10 to All on Wed Nov 4 16:22:23 2026
    On Wed, 4 Nov 2026 02:22:52 -0800
    "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled:
    On 11/4/2026 12:54 AM, boltar@caprica.universe wrote:
    Seems to be your standard response to anyone you disagree with. Go back
    under
    your bridge.


    Really? Why do you have a hatred for say, IOCP? If so, you must also
    HATE AIO, or io_uring?

    I never mentioned IOCP but looking at it, yeah, looks like your standard Windows approach of chucking threads at everything.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From boltar@3:633/10 to All on Wed Nov 4 16:24:03 2026
    On Wed, 4 Nov 2026 11:24:54 +0100
    Jeroen Belleman <jeroen@nospam.please> gabbled:
    On 11/4/26 09:48, boltar@caprica.universe wrote:
    On Mon, 02 Nov 2026 16:51:47 GMT
    Charlie Gibbs <cgibbs@kltpzyxm.invalid> gabbled:
    On 2026-11-02, boltar@caprica.universe <boltar@caprica.universe> wrote:

    On Sun, 1 Nov 2026 21:59:41 +0200

    Michael S <already5chosen@yahoo.com> gabbled:

    On Sun, 1 Nov 2026 08:32:42 -0000 (UTC)
    boltar@caprica.universe wrote:

    On this one where you see code that is only multithreaded in order to >>>>>> serve individual sockets, not because it needs to be.

    That's because many people unable to implement state machines. Or able, >>>>> but don't like them.
    It has nothing to do with availability and functionality of select/poll >>>>> on Windows.

    Last time I had the misfortune to use win32 it couldn't multiplex on >sockets.


    By "multiplex on sockets" do you mean supporting more then one connection >>> on a single socket? Serious question here: could you tell me how this can >>> be useful?

    No I don't mean that and I can't be bother explaining what multiplexing means

    to someone who's clearly never used it.


    Don't be so smug. You could at least give him a hint.
    If you bother enough to reply, you might as well show
    that you know.

    Right, because typing "IO multiplexing" into google or an AI is such an
    arduous task.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Wed Nov 4 10:56:20 2026
    On 11/4/2026 8:22 AM, boltar@caprica.universe wrote:
    On Wed, 4 Nov 2026 02:22:52 -0800
    "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled:
    On 11/4/2026 12:54 AM, boltar@caprica.universe wrote:
    Seems to be your standard response to anyone you disagree with. Go
    back under
    your bridge.


    Really? Why do you have a hatred for say, IOCP? If so, you must also
    HATE AIO, or io_uring?

    I never mentioned IOCP but looking at it, yeah, looks like your standard Windows approach of chucking threads at everything.


    Huh? You mean a thread pool, sometimes we can oversubscribe and use
    hardware threads * 2

    I don't think you should mock IOCP. Then you would be mocking AIO, or io_uring.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From boltar@3:633/10 to All on Wed Nov 4 19:53:33 2026
    On Wed, 4 Nov 2026 10:56:20 -0800
    "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled:
    On 11/4/2026 8:22 AM, boltar@caprica.universe wrote:
    On Wed, 4 Nov 2026 02:22:52 -0800
    "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled:
    On 11/4/2026 12:54 AM, boltar@caprica.universe wrote:
    Seems to be your standard response to anyone you disagree with. Go
    back under
    your bridge.


    Really? Why do you have a hatred for say, IOCP? If so, you must also
    HATE AIO, or io_uring?

    I never mentioned IOCP but looking at it, yeah, looks like your standard
    Windows approach of chucking threads at everything.


    Huh? You mean a thread pool, sometimes we can oversubscribe and use
    hardware threads * 2

    I don't care if its a thread ocean, its still threads being used where they're possibly not needed. Obviously depends on load. But if I'm writing a client such as ssh where the only I/O is via stdin and the socket I'm going to multiplex them in select() or poll(), not have 2 seperate threads.

    I don't think you should mock IOCP. Then you would be mocking AIO, or >io_uring.

    I don't give a toss about IOCP, its a windows thing.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Gary Scott@3:633/10 to All on Wed Nov 4 14:17:02 2026
    On 11/4/2026 1:53 PM, boltar@caprica.universe wrote:
    On Wed, 4 Nov 2026 10:56:20 -0800
    "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled:
    On 11/4/2026 8:22 AM, boltar@caprica.universe wrote:
    On Wed, 4 Nov 2026 02:22:52 -0800
    "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled:
    On 11/4/2026 12:54 AM, boltar@caprica.universe wrote:
    Seems to be your standard response to anyone you disagree with. Go
    back under
    your bridge.


    Really? Why do you have a hatred for say, IOCP? If so, you must also
    HATE AIO, or io_uring?

    I never mentioned IOCP but looking at it, yeah, looks like your standard >>> Windows approach of chucking threads at everything.


    Huh? You mean a thread pool, sometimes we can oversubscribe and use
    hardware threads * 2

    I don't care if its a thread ocean, its still threads being used where they're
    possibly not needed. Obviously depends on load. But if I'm writing a client such as ssh where the only I/O is via stdin and the socket I'm going to multiplex them in select() or poll(), not have 2 seperate threads.

    I don't think you should mock IOCP. Then you would be mocking AIO, or
    io_uring.

    I don't give a toss about IOCP, its a windows thing.
    I sometimes just reserve space in the page file and let the OS lazy write/read.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Jeroen Belleman@3:633/10 to All on Wed Nov 4 23:53:55 2026
    On 11/4/26 17:24, boltar@caprica.universe wrote:
    On Wed, 4 Nov 2026 11:24:54 +0100
    Jeroen Belleman <jeroen@nospam.please> gabbled:
    On 11/4/26 09:48, boltar@caprica.universe wrote:
    On Mon, 02 Nov 2026 16:51:47 GMT
    Charlie Gibbs <cgibbs@kltpzyxm.invalid> gabbled:
    On 2026-11-02, boltar@caprica.universe <boltar@caprica.universe> wrote: >>>>
    On Sun, 1 Nov 2026 21:59:41 +0200

    Michael S <already5chosen@yahoo.com> gabbled:

    On Sun, 1 Nov 2026 08:32:42 -0000 (UTC)
    boltar@caprica.universe wrote:

    On this one where you see code that is only multithreaded in
    order to
    serve individual sockets, not because it needs to be.

    That's because many people unable to implement state machines. Or >>>>>> able,
    but don't like them.
    It has nothing to do with availability and functionality of
    select/poll
    on Windows.

    Last time I had the misfortune to use win32 it couldn't multiplex on
    sockets.


    By "multiplex on sockets" do you mean supporting more then one
    connection
    on a single socket?˙ Serious question here: could you tell me how
    this can
    be useful?

    No I don't mean that and I can't be bother explaining what
    multiplexing means

    to someone who's clearly never used it.


    Don't be so smug. You could at least give him a hint.
    If you bother enough to reply, you might as well show
    that you know.

    Right, because typing "IO multiplexing" into google or an AI is such an arduous task.


    That's fine too, as a hint, no issue there.

    'Multiplexing' is a copiously overloaded concept, so a little
    bit of help to steer him into the right direction is not out
    of place.

    Let's leave it at that.

    Jeroen Belleman

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael S@3:633/10 to All on Fri Nov 6 15:38:55 2026
    On Wed, 4 Nov 2026 23:53:55 +0100
    Jeroen Belleman <jeroen@nospam.please> wrote:

    On 11/4/26 17:24, boltar@caprica.universe wrote:
    On Wed, 4 Nov 2026 11:24:54 +0100
    Jeroen Belleman <jeroen@nospam.please> gabbled:
    On 11/4/26 09:48, boltar@caprica.universe wrote:
    On Mon, 02 Nov 2026 16:51:47 GMT
    Charlie Gibbs <cgibbs@kltpzyxm.invalid> gabbled:
    On 2026-11-02, boltar@caprica.universe <boltar@caprica.universe>
    wrote:
    On Sun, 1 Nov 2026 21:59:41 +0200

    Michael S <already5chosen@yahoo.com> gabbled:

    On Sun, 1 Nov 2026 08:32:42 -0000 (UTC)
    boltar@caprica.universe wrote:

    On this one where you see code that is only multithreaded in
    order to
    serve individual sockets, not because it needs to be.

    That's because many people unable to implement state machines.
    Or able,
    but don't like them.
    It has nothing to do with availability and functionality of
    select/poll
    on Windows.

    Last time I had the misfortune to use win32 it couldn't
    multiplex on
    sockets.


    By "multiplex on sockets" do you mean supporting more then one
    connection
    on a single socket?? Serious question here: could you tell me
    how this can
    be useful?

    No I don't mean that and I can't be bother explaining what
    multiplexing means

    to someone who's clearly never used it.


    Don't be so smug. You could at least give him a hint.
    If you bother enough to reply, you might as well show
    that you know.

    Right, because typing "IO multiplexing" into google or an AI is
    such an arduous task.


    That's fine too, as a hint, no issue there.

    'Multiplexing' is a copiously overloaded concept, so a little
    bit of help to steer him into the right direction is not out
    of place.

    Let's leave it at that.

    Jeroen Belleman

    Unless you didn't pay attention yet, boltar is asshole and proud at
    that.
    Or arshole? I'm not sure what is a correct spelling in his area.




    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From boltar@3:633/10 to All on Fri Nov 6 16:39:45 2026
    On Fri, 6 Nov 2026 15:38:55 +0200
    Michael S <already5chosen@yahoo.com> gabbled:
    On Wed, 4 Nov 2026 23:53:55 +0100
    Jeroen Belleman <jeroen@nospam.please> wrote:
    'Multiplexing' is a copiously overloaded concept, so a little
    bit of help to steer him into the right direction is not out
    of place.
    =20
    Let's leave it at that.
    =20
    Jeroen Belleman

    Unless you didn't pay attention yet, boltar is asshole and proud at
    that.
    Or arshole? I'm not sure what is a correct spelling in his area.

    Neither, but don't worry about it. When you've finished your little sucky
    thumb tantrum maybe mummy will pick up all the toys around your pram for you.



    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Waldek Hebisch@3:633/10 to All on Sat Nov 7 01:17:19 2026
    In comp.lang.c++ Michael S <already5chosen@yahoo.com> wrote:
    On Mon, 2 Nov 2026 15:43:42 -0000 (UTC)
    boltar@caprica.universe wrote:

    On Sun, 1 Nov 2026 21:59:41 +0200
    Michael S <already5chosen@yahoo.com> gabbled:
    On Sun, 1 Nov 2026 08:32:42 -0000 (UTC)
    boltar@caprica.universe wrote:
    On this one where you see code that is only multithreaded in order
    to serve individual sockets, not because it needs to be.


    That's because many people unable to implement state machines. Or
    able, but don't like them.
    It has nothing to do with availability and functionality of
    select/poll on Windows.

    Last time I had the misfortune to use win32 it couldn't multiplex on
    sockets.


    That's nonsense. That part of Winsock2 API did not change since 1993.
    That is, in early 2000s they added poll() (WAASAPoll), but select() is
    the same BSD select() from the very beginning, just a little easier to
    use than original, because nfds is DNC.
    Now, if you woulds say that on Winsock2 select() can't multiplex
    waiting for socket I/O with waiting for other sorts of I/O (files and
    pipes) then your statement would make more sense*.
    But it does not sound like you really want to make sense. You strongly
    prefer mindless bashing.

    ----
    * - Although,
    1) of course, there (in Win32) exist not too complicated alternative
    methods to achieve such multiplexing as well. Just not via select().
    2) today, with nearly all file I/O deeply cached, multiplexing waiting
    for file I/O with waiting for sockets is a bad idea. OTOH, Multiplexing sockets with pipes could still make sense, infrequently.

    Just curious how you solve problem of blocking in single threaded
    program? AFAIK to get data from disc one needs about 10ms or possibly
    more, which is pretty long time on modern machines. Do you assume
    that all data that you need is in RAM (or will be after short startup
    time)?

    --
    Waldek Hebisch

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From boltar@3:633/10 to All on Sat Nov 7 09:41:49 2026
    On Sat, 7 Nov 2026 01:17:19 -0000 (UTC)
    antispam@fricas.org (Waldek Hebisch) gabbled:
    In comp.lang.c++ Michael S <already5chosen@yahoo.com> wrote:
    * - Although,
    1) of course, there (in Win32) exist not too complicated alternative
    methods to achieve such multiplexing as well. Just not via select().
    2) today, with nearly all file I/O deeply cached, multiplexing waiting
    for file I/O with waiting for sockets is a bad idea. OTOH, Multiplexing
    sockets with pipes could still make sense, infrequently.

    Just curious how you solve problem of blocking in single threaded
    program? AFAIK to get data from disc one needs about 10ms or possibly
    more, which is pretty long time on modern machines. Do you assume
    that all data that you need is in RAM (or will be after short startup
    time)?

    Both select() and poll() can be non blocking if you pass a zero timeout value to them. Any file descriptors than can be read from and/or written to will be set in the mask.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael S@3:633/10 to All on Sat Nov 7 20:20:54 2026
    On Sat, 7 Nov 2026 01:17:19 -0000 (UTC)
    antispam@fricas.org (Waldek Hebisch) wrote:

    In comp.lang.c++ Michael S <already5chosen@yahoo.com> wrote:
    On Mon, 2 Nov 2026 15:43:42 -0000 (UTC)
    boltar@caprica.universe wrote:

    On Sun, 1 Nov 2026 21:59:41 +0200
    Michael S <already5chosen@yahoo.com> gabbled:
    On Sun, 1 Nov 2026 08:32:42 -0000 (UTC)
    boltar@caprica.universe wrote:
    On this one where you see code that is only multithreaded in
    order to serve individual sockets, not because it needs to be.


    That's because many people unable to implement state machines. Or
    able, but don't like them.
    It has nothing to do with availability and functionality of
    select/poll on Windows.

    Last time I had the misfortune to use win32 it couldn't multiplex
    on sockets.


    That's nonsense. That part of Winsock2 API did not change since
    1993. That is, in early 2000s they added poll() (WAASAPoll), but
    select() is the same BSD select() from the very beginning, just a
    little easier to use than original, because nfds is DNC.
    Now, if you woulds say that on Winsock2 select() can't multiplex
    waiting for socket I/O with waiting for other sorts of I/O (files
    and pipes) then your statement would make more sense*.
    But it does not sound like you really want to make sense. You
    strongly prefer mindless bashing.

    ----
    * - Although,
    1) of course, there (in Win32) exist not too complicated alternative methods to achieve such multiplexing as well. Just not via select().
    2) today, with nearly all file I/O deeply cached, multiplexing
    waiting for file I/O with waiting for sockets is a bad idea. OTOH, Multiplexing sockets with pipes could still make sense,
    infrequently.

    Just curious how you solve problem of blocking in single threaded
    program?

    I don't.
    If it is important and I expect that file operation will take
    significant time then I do it in another thread.
    May be, if I were doing server-side I'd treat it differently, but on
    cleent it's unlikely that I don't have more hardware threads than work
    to do, so separate thread is just right thing to do in such case.
    Assuming, of course, that performance at all matters, which is uncommon.


    AFAIK to get data from disc one needs about 10ms or possibly
    more, which is pretty long time on modern machines.

    I absolutly do not care about spinning rust. For close to 15 years.

    Do you assume
    that all data that you need is in RAM (or will be after short startup
    time)?


    In practice, it's extremely likely that all data is in system's file
    cache, i.e. in RAM.






    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Sat Nov 7 12:19:44 2026
    On 11/7/2026 10:20 AM, Michael S wrote:
    On Sat, 7 Nov 2026 01:17:19 -0000 (UTC)
    antispam@fricas.org (Waldek Hebisch) wrote:

    In comp.lang.c++ Michael S <already5chosen@yahoo.com> wrote:
    On Mon, 2 Nov 2026 15:43:42 -0000 (UTC)
    boltar@caprica.universe wrote:

    On Sun, 1 Nov 2026 21:59:41 +0200
    Michael S <already5chosen@yahoo.com> gabbled:
    On Sun, 1 Nov 2026 08:32:42 -0000 (UTC)
    boltar@caprica.universe wrote:
    On this one where you see code that is only multithreaded in
    order to serve individual sockets, not because it needs to be.


    That's because many people unable to implement state machines. Or
    able, but don't like them.
    It has nothing to do with availability and functionality of
    select/poll on Windows.

    Last time I had the misfortune to use win32 it couldn't multiplex
    on sockets.


    That's nonsense. That part of Winsock2 API did not change since
    1993. That is, in early 2000s they added poll() (WAASAPoll), but
    select() is the same BSD select() from the very beginning, just a
    little easier to use than original, because nfds is DNC.
    Now, if you woulds say that on Winsock2 select() can't multiplex
    waiting for socket I/O with waiting for other sorts of I/O (files
    and pipes) then your statement would make more sense*.
    But it does not sound like you really want to make sense. You
    strongly prefer mindless bashing.

    ----
    * - Although,
    1) of course, there (in Win32) exist not too complicated alternative
    methods to achieve such multiplexing as well. Just not via select().
    2) today, with nearly all file I/O deeply cached, multiplexing
    waiting for file I/O with waiting for sockets is a bad idea. OTOH,
    Multiplexing sockets with pipes could still make sense,
    infrequently.

    Just curious how you solve problem of blocking in single threaded
    program?

    I don't.
    If it is important and I expect that file operation will take
    significant time then I do it in another thread.
    May be, if I were doing server-side I'd treat it differently, but on
    cleent it's unlikely that I don't have more hardware threads than work
    to do, so separate thread is just right thing to do in such case.
    Assuming, of course, that performance at all matters, which is uncommon.


    AFAIK to get data from disc one needs about 10ms or possibly
    more, which is pretty long time on modern machines.

    I absolutly do not care about spinning rust. For close to 15 years.

    Do you assume
    that all data that you need is in RAM (or will be after short startup
    time)?


    In practice, it's extremely likely that all data is in system's file
    cache, i.e. in RAM.

    In say, IOCP, AIO, etc, we can use a single thread to handle that, no
    problem. But you will lose the concurrency the system provides. We can intermix file io and socket io. No problem.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From boltar@3:633/10 to All on Sun Nov 8 09:10:38 2026
    On Sat, 7 Nov 2026 20:20:54 +0200
    Michael S <already5chosen@yahoo.com> gabbled:
    On Sat, 7 Nov 2026 01:17:19 -0000 (UTC)
    antispam@fricas.org (Waldek Hebisch) wrote:
    Just curious how you solve problem of blocking in single threaded
    program?

    I don't.
    If it is important and I expect that file operation will take
    significant time then I do it in another thread.

    So you don't understand the concept of non-blocking I/O.

    AFAIK to get data from disc one needs about 10ms or possibly
    more, which is pretty long time on modern machines.

    I absolutly do not care about spinning rust. For close to 15 years.

    15 years ago commercial SSDs were expensive, low capacity and failure prone.


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