Recent

Author Topic: Question about an asynchronous algorithm  (Read 1685 times)

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1088
  • Professional amateur ;-P
Question about an asynchronous algorithm
« on: July 27, 2021, 04:34:46 pm »
Hey Remy,

I'm trying to do a modularized system that communicates via IPC between all the modules.

I've got most of the big picture sorted out but there's a step that I'm missing cuz I don't know enough about Indy10's context lists to think about how to do it.

So here's the gist of the matter:
  • A client connects to the server and sends a message/command that needs a reply
  • The server packages that request inside an IPC message(Including an ID for the requester's context) and pushes it to the IPC system
  • The IPC system reads that message, relays it to the module that should deal with it
  • The module does it's work and then packages the result in an IPC message and pushes it to the IPC system
  • The IPC system reads that message and relays it to the server module to deal with it
  • And this step is where I'm stuck

I'm stuck cuz on step 6 cuz I don't know how to use the context ID to now send the answer.

Do I get the locked list in it's entirety, loop through it and then send the reply?
Is there an indexed property I can use?
And how do I do all this in a thread safe manner?

How would I go about it?

Many, MANY thanks in advance Remy!!

Cheers,
Gus
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

 

TinyPortal © 2005-2018