I was using a spin/loop to wait the lock word.
But now I'm using ENQ/DEQ that is more reliable.
It is just used in SMF exits USI, UJI and ACTRT and SMS POST0 exit.

Thanks to all of you with your tips and warnings.
Regards
João


-----Mensagem original-----
De: IBM Mainframe Assembler List <ASSEMBLER-LIST@LISTSERV.UGA.EDU> Em nome
de Peter Relson
Enviada em: terça-feira, 10 de dezembro de 2024 10:46
Para: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Assunto: Re: SETLOCK OBTAIN CML/CMS

Shmuel wrote:

<snip>

As long as you're serializing the queue and can distinguish the various
feeds, why do you need sequence numbers?

</snip>



A goal was to avoid serializing the queue to save cycles. It is certainly
true that if the queue manipulations are totally serialized (such as by an
exclusive ENQ) then you do not need other serialization (such as CDS
involving a sequence number).



Joao wrote:

<snip>

I lock the word, insert data in the FIFO queue and update the next available

entry pointer.

Then I unlock the word.

</snip>



You have not answered the question of what another thread is to do if it
encounters the word's being locked.

Wait for some amount of time such as by STIMERM then look again? Wait on
some ECB that will be posted when the word is unlocked? Loop/Spin until the
word is not locked?

None of those generally is a viable/practical approach. ENQ and SETLOCK
handle that for you but are much slower than the approach Jonathan Scott
mentioned, if you can have a single consumer of the work queue (where that
single consumer could parcel out the work to multiple worker threads if it
so chose).


Peter Relson
z/OS Core Technology Design

Reply via email to