Processes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Processes

highbeg
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
Reply | Threaded
Open this post in threaded view
|

Re: Processes

Holger Freyther
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 <[hidden email]> 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


Reply | Threaded
Open this post in threaded view
|

Re: Processes

highbeg
Hello Holger!

The  version of Smalltalk I tested was the one included with Ubuntu 20.04.

Is the newer, linked to version you're suggesting 3.2.91 by any chance?

Many thanks,

Gary



On Tue, Jan 26, 2021, 2:11 AM Holger Freyther <[hidden email]> wrote:

> 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 <[hidden email]>
> 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
>
>
Reply | Threaded
Open this post in threaded view
|

RE: Processes

mbratch
In reply to this post by Holger Freyther

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 Mail for Windows 10

 

From: [hidden email]
Sent: Tuesday, January 26, 2021 2:12 AM
To: [hidden email]
Cc: [hidden email]
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 <[hidden email]> 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

 

 

 

Reply | Threaded
Open this post in threaded view
|

Re: Processes

stes

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 [hidden email]:

> 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:[hidden email] | Holger Freyther ]
> Sent: Tuesday, January 26, 2021 2:12 AM
> To: [ mailto:[hidden email] | Gary Highberger ]
> Cc: [ mailto:[hidden email] | 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 <[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: Processes

stes
In reply to this post by highbeg

Also if you assign the Process to a variable ('a' below),
you could yield


GNU Smalltalk ready

st> a _ [[true] whileTrue: [
st> (Time now) printNl .
st> (Delay forSeconds: 1) wait
st> ]
st> ]fork
18:36:29
Process(nil at userSchedulingPriority, ready to run)

st> [true] whileTrue:[a yield]
18:37:19
18:37:20
18:37:21

however the most logical modification is to add some wait after the fork,
like in:

[[true] whileTrue: [
        (Time now) printNl .
        (Delay forSeconds: 1) wait
        ]
]fork.
(Delay forSeconds:10) wait


----- Op 26 jan 2021 om 11:05 schreef Gary Highberger [hidden email]:

> Hello Holger!
>
> The  version of Smalltalk I tested was the one included with Ubuntu 20.04.
>
> Is the newer, linked to version you're suggesting 3.2.91 by any chance?
>
> Many thanks,
>
> Gary
>
>
>
> On Tue, Jan 26, 2021, 2:11 AM Holger Freyther <[hidden email]> wrote:
>
>> 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 <[hidden email]>
>> 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
>>

Reply | Threaded
Open this post in threaded view
|

Re: Processes

highbeg
In reply to this post by stes
Excellent work David! A thousand Thanks.
Gary

On Tue, Jan 26, 2021, 12:06 PM [hidden email] <[hidden email]> 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 [hidden email]:
>
> > 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:[hidden email] | Holger Freyther ]
> > Sent: Tuesday, January 26, 2021 2:12 AM
> > To: [ mailto:[hidden email] | Gary Highberger ]
> > Cc: [ mailto:[hidden email] | 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 <[hidden email]>
> 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
>
Reply | Threaded
Open this post in threaded view
|

Re: Processes

highbeg
Hi David,

I'm good to go for and am updating Smalltalk as suggested by Holger. For
the sake of completeness I'm enclosing a link to a program, tst1.st' which
runs for 10 seconds or so then displays Alarm Clock then crashes.

Not a biggie at this point. I'm just letting everyone know and hoping
tst1.st won't crash after upgrading.

https://www.dropbox.com/s/25tt5gstpkfitkh/tst1.st?dl=0

Many thanks to everyone for helping me learn Smalltalk.

Gary


On Tue, Jan 26, 2021, 1:00 PM Gary Highberger <[hidden email]>
wrote:

> Excellent work David! A thousand Thanks.
> Gary
>
> On Tue, Jan 26, 2021, 12:06 PM [hidden email] <[hidden email]> 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 [hidden email]:
>>
>> > 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:[hidden email] | Holger Freyther ]
>> > Sent: Tuesday, January 26, 2021 2:12 AM
>> > To: [ mailto:[hidden email] | Gary Highberger ]
>> > Cc: [ mailto:[hidden email] | 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 <[hidden email]>
>> 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
>>
>