Is there anyway of getting 2 bits of Squeak running at the same time?
E.G
Online blocks are slow, so is there a way of programming them to:
Run 1 line of its Squeak..
While its doing that continue Squeak code...
Offline
Preemptive multitasking?
Asynchronous server data fetching?
In Squeak?
I don't think so. You would need to be able to control processes and possibly initialize a new one, which I don't think is possible in Squeak. Notice how Scratch always freezes when saving a project or opening a dialog box? That's because it's a single thread action. I should think the Scratch team would have implemented multi-threading for such operations if they could have.
So, as far as I know, no.
Offline
Yes.
It is very very hard, you would have to make some extra codes, like BYOBs doFork, but modified for scratch, then you would have to make another special form code which would do fork or something, it is a bit confusing, I don't think you would be able to do it easily.
Offline
LS97 wrote:
Preemptive multitasking?
Asynchronous server data fetching?
In Squeak?
I don't think so. You would need to be able to control processes and possibly initialize a new one, which I don't think is possible in Squeak. Notice how Scratch always freezes when saving a project or opening a dialog box? That's because it's a single thread action. I should think the Scratch team would have implemented multi-threading for such operations if they could have.
So, as far as I know, no.
*coughtheBYOBLAUNCHblockcough*
Last edited by scimonster (2011-05-29 13:50:02)
Offline
Like this:
newThread _ [putHere theMethodYouWantToRun] newProcess. newThread priority: Processor userInterruptPriority. newThread resume.
EDIT: To make it clear, this doesn't affect Scratch's execution engine, but actually creates a new Squeak thread. The program does slow down slightly though.
Last edited by TheSuccessor (2011-05-29 13:38:26)
Offline
scimonster wrote:
LS97 wrote:
Preemptive multitasking?
Asynchronous server data fetching?
In Squeak?
I don't think so. You would need to be able to control processes and possibly initialize a new one, which I don't think is possible in Squeak. Notice how Scratch always freezes when saving a project or opening a dialog box? That's because it's a single thread action. I should think the Scratch team would have implemented multi-threading for such operations if they could have.
So, as far as I know, no.*coughtheBYOBRUNblockcough*
You mean launch
Offline
Pecola1 wrote:
scimonster wrote:
LS97 wrote:
Preemptive multitasking?
Asynchronous server data fetching?
In Squeak?
I don't think so. You would need to be able to control processes and possibly initialize a new one, which I don't think is possible in Squeak. Notice how Scratch always freezes when saving a project or opening a dialog box? That's because it's a single thread action. I should think the Scratch team would have implemented multi-threading for such operations if they could have.
So, as far as I know, no.*coughtheBYOBRUNblockcough*
You mean launch
Ooops.
Offline
To all those that coughed the Launch block, it's not the same thing.
That block simply acts like the broadcast block which doesn't wait for the script to finish, but doesn't actually multi-task.
TheSuccessor's method seems like a valid one, on the other hand. Nice!
Offline
TheSuccessor wrote:
Like this:
Code:
newThread _ [putHere theMethodYouWantToRun] newProcess. newThread priority: Processor userInterruptPriority. newThread resume.EDIT: To make it clear, this doesn't affect Scratch's execution engine, but actually creates a new Squeak thread. The program does slow down slightly though.
Any way to get this done with a reporter?
Offline