Process & Fork

Quenio dos Santos <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.gnu.general
Message-ID <CAJ6rE1xv5H9PP9kcadyXN=TGwpAg+YP+wqO5UF5LOdSRwpxBVQ@mail.gmail.com>
Hello,

I'm running the following program with two simple processes (the main one
and a forked process):

[
  | i |
  i := 0.
  [ true ] whileTrue: [
    i := i + 1.
    i displayNl.
    (Delay forSeconds: 1) wait
  ]
] fork.

[ true ] whileTrue: [
  Processor yield
]

I was expecting these two processes to run indefinitely, but the program
hangs after printing a few lines:

1
2
3

And then I have to interrupt it.

I'm wondering if there's something basic I'm missing here. Maybe I don't
understand how "Process yield" works, but I thought it was just going to
suspend the current process and let the forked process run.

Any help is appreciated,
    Quenio
_______________________________________________
help-smalltalk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
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.