[Gambas-user] Opening Pipes (avoiding lockup)

Bruce Steers bsteers4 at gmail.com
Sun Oct 4 13:23:44 CEST 2020

>  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.

I just removed the echo command in my app and now yes on 3.15 it works
okay. (I must have missed the memo lol)

Thing is Benoit for me i think it's also about which version of gambas
others may be using.
I'm trying to get gambas beyond the "Personal App Maker" reputation here by
making apps useful to all..
incompatibilities between versions are an issue that hinder gambas I think.

Like how does the new "non-blocking" mode work for older gambas? is it only
on the 3.15 runtime it works?
Ie. if i compile an app on 3.15 with GB_PCODE_VERSION=3.8 set and not use
the "Shell echo" method will it block on a previous interpreter?

As it stands with making software for others to also use there are at least
the following problems...
Without the GB_PCODE_VERSION=3.8 hint you gave me any user out there who
hasn't managed to upgrade their gambas from their main linux distro repo to
the latest 3.15 would not even be able to run my app, without having to
load it into their version of the gambas IDE and re-compile. (for folks
like you and I it's no problem but the average Joe doesn't think like us;) )

And if i haven't removed the CurrentArgument setting from a .project file
on a 3.15 project the average user wouldn't even be able to load the
project into a lesser gambas IDE as it fails with a type mismatch.

For folks like you and I it's no problem to work out glitches like that ,
but to the average use they're just going to think
 gambas is rubbish, apps hardly ever work and they can't even load the
source into their gambas IDE.. :(
 (Except for Bruces ones, they work okay ;) lol )

I certainly think it's a consideration to keep our eyes on.
I'm making apps for me AND the average user but the "average user" won't
have upgraded, they'll be on the version they got when they used their
linux distro's software installer.

Thank you all :)
Bruce Steers

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/fdad0ace/attachment-0001.htm>

More information about the User mailing list