[Lazarus] stale pipe workarounds

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] stale pipe workarounds

Free Pascal - Lazarus mailing list
Hi while researching help systems I came across the code which uses IPC to
communicate and see that people are adding stale pipe work arounds.

So this can't be resolved in the ipc code itself and must be in the
application?  Just wondering why these work arounds are needed and when
they occur. The stale pipe code work around is at

https://github.com/graemeg/lazarus/blob/upstream/components/chmhelp/packages/help/lhelpcontrol.pas

So does anyone who uses IPC have to be aware of this and add the work
around to all ipc code in all applications?  Or it only happens in certain
cases? It just makes me scared that there is this hack/fix needed.
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] stale pipe workarounds

Free Pascal - Lazarus mailing list
On 11/19/2016 10:50 PM, Lars via Lazarus wrote:

> Hi while researching help systems I came across the code which uses IPC to
> communicate and see that people are adding stale pipe work arounds.
>
> So this can't be resolved in the ipc code itself and must be in the
> application?  Just wondering why these work arounds are needed and when
> they occur. The stale pipe code work around is at
>
> https://github.com/graemeg/lazarus/blob/upstream/components/chmhelp/packages/help/lhelpcontrol.pas
>
> So does anyone who uses IPC have to be aware of this and add the work
> around to all ipc code in all applications?  Or it only happens in certain
> cases? It just makes me scared that there is this hack/fix needed.

FPC now has this stale pipe detection included. The fix was added to the
code lazarus uses until the next official version of FPC was released
and went into the develop version of fpc in early 2012. At this point it
could probably be removed form lazarus since there have been multiple
releases of fpc since then.

https://github.com/graemeg/freepascal/blob/master/packages/fcl-process/src/unix/simpleipc.inc#L97

https://github.com/graemeg/freepascal/commit/439236b9df1e952ad0fc1da42f05851dfea459ac


Regards,

Andrew Haines


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] stale pipe workarounds

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On 2016-11-20 03:50, Lars via Lazarus wrote:
> It just makes me scared that there is this hack/fix needed.


No need to worry, the Lazarus code is outdated. That fix is already in
FPC 2.6.4 too, and any FPC release after that.

I've been using SimplyIPC for many things and it has worked very well.
eg: Implementing a single instance application feature. The second
instance will detected the IPC comms, and use it to tell the first
instance what to do (eg: open another file), then the second instance
will terminate.

I've also implemented a visual logging/debugging program, using
simpleIPC, to overcome some shortcomings of Lazarus+GDB debugging. Think
Raize Software's CodeSite product for Delphi (but not as advanced). In
this tool I did notice one issue with SimpleIPC under Windows only. When
I fired 100's of log events per second, under Windows, I lost some
messages. I believe I did file a bug report on this. It was some 5-6
years ago, and it was a very specific case. For day-to-day usage,
SimpleIPC works perfectly though.

Regards,
  Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] stale pipe workarounds

Free Pascal - Lazarus mailing list


On Sun, 20 Nov 2016, Graeme Geldenhuys via Lazarus wrote:

> On 2016-11-20 03:50, Lars via Lazarus wrote:
>> It just makes me scared that there is this hack/fix needed.
>
>
> No need to worry, the Lazarus code is outdated. That fix is already in
> FPC 2.6.4 too, and any FPC release after that.
>
> I've been using SimplyIPC for many things and it has worked very well.
> eg: Implementing a single instance application feature. The second
> instance will detected the IPC comms, and use it to tell the first
> instance what to do (eg: open another file), then the second instance
> will terminate.
>
> I've also implemented a visual logging/debugging program, using
> simpleIPC, to overcome some shortcomings of Lazarus+GDB debugging. Think
> Raize Software's CodeSite product for Delphi (but not as advanced). In
> this tool I did notice one issue with SimpleIPC under Windows only. When
> I fired 100's of log events per second, under Windows, I lost some
> messages. I believe I did file a bug report on this. It was some 5-6
> years ago, and it was a very specific case. For day-to-day usage,
> SimpleIPC works perfectly though.

The windows issue should meanwhile have been fixed, all platforms now use a queue.

Michael.
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] stale pipe workarounds

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Sun, 20 Nov 2016 01:01:13 -0500
Andrew Haines via Lazarus <[hidden email]> wrote:

>[...]
> FPC now has this stale pipe detection included. The fix was added to the
> code lazarus uses until the next official version of FPC was released
> and went into the develop version of fpc in early 2012. At this point it
> could probably be removed form lazarus since there have been multiple
> releases of fpc since then.
>
> https://github.com/graemeg/freepascal/blob/master/packages/fcl-process/src/unix/simpleipc.inc#L97

Yes, it was already in FPC 2.6.4.
So, the lhelpcontrol $IF FPC_FULLVERSION<20700 is wrong.
I removed the old workaround.

Mattias
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus