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
help-smalltalk@gnu.org
https://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to