Re: Processes

Gary Highberger <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.gnu.general
Message-ID <CAAWCt5zXYoD+ZHhjibVCeNWEHK10n1dWV=vSer1HD3F_og_JLg@mail.gmail.com>
Excellent work David! A thousand Thanks.
Gary

On Tue, Jan 26, 2021, 12:06 PM [email protected] <[email protected]> wrote:

>
> All,
>
> The first program
>
> $ cat tst.st
> " Ref: Blue Book pg. 266
>   This program works. Type gst tst.st at the Linux
>   prompt and find out for yourself.
> "
> [[true] whileTrue: [
>         (Time now) printNl .
>         (Delay forSeconds: 1) wait
>         ]
> ] value
>
> continues forever for me (until I control-C stop gst) and prints the
> current time every second.
>
> The second program
>
> $ cat tstX.st
> " Ref: Blue Book pg. 266
>   This program doesn't work. Type gst tstX.st at the Linux
>   prompt and find out for yourself.
> "
> [[true] whileTrue: [
>         (Time now) printNl .
>         (Delay forSeconds: 1) wait
>         ]
> ]fork
>
> Just prints one line (the current time) (1 line) and then exits for me.
>
> However it is perhaps not a bad idea to try to add a Delay forSeconds:10
> wait after the fork in the main process.
>
> If the main process waits another 10 seconds, then it prints 10 lines for
> me, I just added a line after the fork:
>
> fork.
> (Delay forSeconds:10) wait
>
> Also I suppose it is possible to wait for the forked process itself so
> that it continues indefinitely.
>
> The problem is that the main process has exited and so the forked process
> is also gone.
>
> However if the main GST process keeps around, then the above second
> program also works.
>
> Regards,
> David Stes
>
>
> ----- Op 26 jan 2021 om 13:20 schreef Mark Bratcher [email protected]:
>
> > Hi Holger
> >
> > I tried Gary’s test samples on 3.2.91 and it exhibits the same behavior
> as
> > 3.2.5.
> >
> > Mark
> >
> > Sent from [ https://go.microsoft.com/fwlink/?LinkId=550986 | Mail ] for
> Windows
> > 10
> >
> > From: [ mailto:[email protected] | Holger Freyther ]
> > Sent: Tuesday, January 26, 2021 2:12 AM
> > To: [ mailto:[email protected] | Gary Highberger ]
> > Cc: [ mailto:[email protected] | help-smalltalk ]
> > Subject: Re: Processes
> >
> > Hi Gary!
> >
> > How did you get GNU Smalltalk 3.2.5? On the surface this sounds like a
> problem
> > already fixed[1] in the development branch of GNU Smalltalk? Could you
> try to
> > cherry-pick this[1] and see if the problem persists?
> >
> > thank you
> >
> > holger
> >
> > [1]
> >
> http://git.savannah.gnu.org/cgit/smalltalk.git/commit/?id=72ada189aba0283c551ead16635c1983968080b8
> >
> >> On 26. Jan 2021, at 10:53, Gary Highberger <[email protected]>
> wrote:
> >
> >>
> >
> >> Hi Help-Smalltalk,
> >
> >>
> >
> >> If processes aren't supported in 3.2.5 then read no further :-)
> >
> >>
> >
> >> Forks or Delays might be broken in 3.2.5. I totally hope I'm wrong or
> that
> >
> >> there's a clean workaround.
> >
> >>
> >
> >> For what I can tell, Forked* infinite loop processes containing a Delay
> >
> >> won't run.*
> >
> >>
> >
> >> Links to two Smalltalk programs based on an infinite loop, Delay, fork,
> >
> >> example from the Bluebook follow:
> >
> >>
> >
> >> https://www.dropbox.com/s/rs4iobnhh6vzmc4/tst.st?dl=0
> >
> >>
> >
> >> https://www.dropbox.com/s/0zybbef44e45w3c/tstX.st?dl=0
> >
> >>
> >
> >> At the Linux prompt enter gst tst.st to observe desired behavior.
> >
> >>
> >
> >> At the Linux prompt enter gst tstX.st to see the failed fork behavior.
> >
> >>
> >
> >> Any help you can provide will be greatly appreciated!
> >
> >>
> >
> >> Thank you,
> >
> >>
> >
> > > Gary Highberger
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.