[Gambas-user] Opening Pipes (avoiding lockup)

Bruce Steers bsteers4 at gmail.com
Sun Oct 4 12:37:01 CEST 2020


Well according to your reply to the other person you've fixed it in 3.15
So that'd just be a waste of time..

Seems those who've managed to upgrade to the unstable beta version or self
compiled it won't find that problem anymore.
Just normal people will ;) lol

On Sat, 3 Oct 2020 at 23:08, Benoît Minisini <g4mba5 at gmail.com> wrote:

> Le 03/10/2020 à 20:55, Bruce Steers a écrit :
> > Hi all.
> > I just uploaded a simple pipe opening/watching routing to the
> > Application section as an example.
> > The reason for this was because it took me quite some time to figure out
> > how to get a pipe working at first and thought many others may have hit
> > the same brick wall. It seemed EVERYTHING I tried just locked up the app
> > til the pipe got some text sent, then everything was okay, the app could
> > run and the File_Read() event would trigger on any more text sent as
> > expected.
> >
> > What was not expected is that "Opening" the pipe is like calling a Read
> > method that locks the program till it gets some text.
> > I came up with a simple solution (eventually) to use the Shell command
> > to echo a blank line to the pipe just before opening it...
> >
> >   Shell "echo '' >/tmp/FIFO1"
> >   hFile = Pipe "/tmp/FIFO1" For Read Watch
> >
> > That way when the pipe opens it gets the echo and moves on so the
> > program continues running.
> > It just seemed wrong though.
> > Like either i was doing something wrong in how i was opening the pipe or
> > it was a bug in the pipe opening call?
> > I would have thought that setting the "Watch" option would open the pipe
> > without expecting text and just set up the Read event and move on.
> >
> > I found using "Read Write Watch" all together and setting Blocking to
> > False Allowed the program to move past the open without sending text but
> > that gave me weird errors like pop-up menus stopped triggering Click()
> > events, I had some menus visible in the menubar AND attached to a button
> > popup and got the click event okay from the top menu but got nothing
> > from the popup menus. If i removed the "Write" from the pipe opening
> > call the popups worked again!?
> > I found the Shell "echo" method the best way but like i say , seems
> > wrong to have to do it that way.
> >
> > Thanks all :)
> >
> >
> >
> > ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
> >
>
> I have no locking problem with opening a pipe for reading and watching.
> Please post your project and tell which version of Gambas you are using.
>
> Regards,
>
> --
> Benoît Minisini
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20201004/fb27483a/attachment.htm>


More information about the User mailing list