[fpc-devel] simpleipc issues

Michael Van Canneyt michael at freepascal.org
Tue Sep 15 08:58:00 CEST 2015

On Mon, 14 Sep 2015, Ondrej Pokorny wrote:

> I've developed a "single/multiple instances" feature for the Lazarus IDE. For 
> this feature I need an IPC. First I tried to use simpleipc but I have 
> struggled on bugs and missing functionality.
> Particularly what I found:
> 1.) BUG: You can register multiple servers on Windows with the same name 
> (with StartServer procedure).
> 2.) Small issue: simpleipc uses exceptions if something fails (e.g. in 
> StartServer procedure). I would prefer using a function with boolean result 
> (true = OK, false = fail).
> 3.) MISSING: Multiple clients (from different processes) talk to one server.
> 4.) MISSING: Client is able to receive a response on a request.
> 5.) MISSING: (Optionally, not default) client sends a request to a server 
> that isn't running. The server is able to handle these requests when it is 
> started.
> So I developed "advancedipc.pas" that does what I need. It can do everything 
> that is in simpleirc but a little bit differently (I changed the exception 
> behavior and also method names). The question is now what to do?
> 1.) Include advancedipc.pas into FCL as a standalone unit.
> 2.) Make advancedipc.pas backwards compatible to simpleipc.pas and use the 
> new code in simpleipc.pas.

Well, both 1 and 2 are the way to go if you want it included in FPC :-)

I see no point in including duplicate functionality, it means duplicate maintenance. 
You can keep it as separate units, just make sure simpleipc runs on top of advancedipc.

As for no semaphores on linux: of course there are semaphores, they exist since 
many many years, they are part of POSIX: "man sem_overview".


More information about the fpc-devel mailing list