I feel like I'm missing something basic, but this seems wrong. Running VA 7.5.2. It's a Plain Vanilla abt image. I'm running the code below in a workspace as an example.
| counter forkedProc |
counter := 0.
Transcript cr; show: '-------------------'.
forkedProc := [[counter > 50] whileFalse:[Transcript cr; show: counter printString. counter := counter + 1. (Delay forMilliseconds: 100) wait]] forkAt: Processor userInterruptPriority.
[counter > 50] whileFalse:[Transcript cr; show: 'main thread '; show: counter printString. counter := counter + 1. (Delay forMilliseconds: 100) wait.].
Transcript cr; show: 'done fnoodling'.
It produces the output below.
-------------------
main thread 0
main thread 1
main thread 2
main thread 3
main thread 4
main thread 5
<snipped for brevity, no output from forked process appears>
main thread 46
main thread 47
main thread 48
main thread 49
main thread 50
done fnoodling
51
Regardless of the priority of forkedProc, it never seems to get any time until after the main thread is done. I would have expected something more mixed such as:
0
main thread 1
2
main thread 3
4
main thread 5
...
Anyone have any ideas? Or perhaps someone has a link to some documentation on how the process scheduler works in regards to the UI Process & Delays? And perhaps would know if this is a change in recent versions of VA or VisualAge? ..
As an aside, if I fork the second #whileFalse: loop, regardless of priority, I do see intermixed output.
thx
eric