Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > comp.os.vms > #378350

Re: more CMA

From cross@spitfire.i.gajendra.net (Dan Cross)
Newsgroups comp.os.vms
Subject Re: more CMA
Date 2025-12-08 20:55 +0000
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <10h7e08$6as$1@reader2.panix.com> (permalink)
References <10gqr6c$3saak$1@dont-email.me> <10gsoje$kori$1@dont-email.me> <10gssnv$fd7v$3@dont-email.me> <69345887$0$663$14726298@news.sunsite.dk>

Show all headers | View raw


In article <69345887$0$663$14726298@news.sunsite.dk>,
Arne Vajhøj  <arne@vajhoej.dk> wrote:
>On 12/4/2025 3:59 PM, Arne Vajhøj wrote:
>> On 12/4/2025 2:49 PM, Simon Clubley wrote:
>>> 1) What is the reason for using the CMA interface instead of the pthread
>>> interface ? If there is no specific reason, perhaps rewriting it as a
>>> pthreads application might give some clues.
>> 
>> I already have working pthreads code.
>> 
>> I wanted to do the same with cma.
>
>There are something in cma not present in pthread.
>
>The cma API comes with the cma_lib_queue_* functions.

Presumably this doesn't exist in pthreads because it's simple to
do oneself using the tools that interface gives you (mutexes and
condition variables, specifically).

For example, I whipped this up earlier today as a demonstration:
https://github.com/dancrossnyc/cqueue/blob/main/cqueue.c

(The `try_*` implementations left as an exercise for the reader;
they are very simple, but I just could't be bothered.)

Nothing in the CMA lib APIs strikes me as particularly worth
adding it to the interface, and one can imagine all sorts of
enhancements that it just doesn't provide (prioritization;
fairness; sending by value instead of reference, etc).

For non-trivial applications, I imagine the pthreads folks
decided that it was probably better to do it yourself, or find
a third-party library better suited to the specific use case.

>Doing similar to java.util.concurrent.BlockingQueue
>if you are familiar with that.

Well, not quite.  That's generic over some element type, E.  The
CMA library functions, and my own trivial example, just use a
pointer, which is rather different.

	- Dan C.

Back to comp.os.vms | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

more CMA Arne Vajhøj <arne@vajhoej.dk> - 2025-12-03 21:21 -0500
  Re: more CMA kludge@panix.com (Scott Dorsey) - 2025-12-03 21:38 -0500
    Re: more CMA Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> - 2025-12-04 13:40 +0000
  Re: more CMA Roy Omond <roy@omond.net> - 2025-12-04 12:04 +0000
    Re: more CMA Arne Vajhøj <arne@vajhoej.dk> - 2025-12-04 09:23 -0500
      Re: more CMA Volker Halle <volker_halle@hotmail.com> - 2025-12-04 16:48 +0100
        Re: more CMA Arne Vajhøj <arne@vajhoej.dk> - 2025-12-04 11:55 -0500
      Re: more CMA Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> - 2025-12-04 18:29 +0000
        Re: more CMA Arne Vajhøj <arne@vajhoej.dk> - 2025-12-04 14:12 -0500
          Re: more CMA Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> - 2025-12-04 19:49 +0000
            Re: more CMA Arne Vajhøj <arne@vajhoej.dk> - 2025-12-04 15:59 -0500
              Re: more CMA Arne Vajhøj <arne@vajhoej.dk> - 2025-12-06 11:23 -0500
                Re: more CMA cross@spitfire.i.gajendra.net (Dan Cross) - 2025-12-08 20:55 +0000
                Re: more CMA Arne Vajhøj <arne@vajhoej.dk> - 2025-12-08 21:06 -0500
                Re: more CMA cross@spitfire.i.gajendra.net (Dan Cross) - 2025-12-09 04:46 +0000
          Re: more CMA Arne Vajhøj <arne@vajhoej.dk> - 2025-12-04 16:55 -0500
            Re: more CMA cross@spitfire.i.gajendra.net (Dan Cross) - 2025-12-05 17:15 +0000
              Re: more CMA Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> - 2025-12-05 18:06 +0000
                Re: more CMA cross@spitfire.i.gajendra.net (Dan Cross) - 2025-12-08 12:33 +0000
              Re: more CMA Arne Vajhøj <arne@vajhoej.dk> - 2025-12-05 18:39 -0500
                Re: more CMA cross@spitfire.i.gajendra.net (Dan Cross) - 2025-12-08 14:14 +0000
      Re: more CMA hb0815 <mw40171@mucweb.de> - 2025-12-05 21:52 +0100
        Re: more CMA Arne Vajhøj <arne@vajhoej.dk> - 2025-12-05 18:21 -0500

csiph-web