Discuss Scratch

SpyCoderX
Scratcher
1000+ posts

All at Once/Run in Parallel Block

But why? What’s the use of this?
bubgamer07
Scratcher
100+ posts

All at Once/Run in Parallel Block

SpyCoderX wrote:

But why? What’s the use of this?
all at once {
glide (1) secs to x: (0) y: (0)
say [wee!] for (1) secs
} :: control
though i guess in that case you could just do
say [wee!]
glide (1) secs to x: (0) y: (0)
say []
nembence
Scratcher
500+ posts

All at Once/Run in Parallel Block

VedanshS933 wrote:

(#63)

medians wrote:

Can you somehow change the block name or something so it doesn't get confused with the 2.0 alpha all at once block?

You could suggest one. I don't have any ideas
What about this?
run in parallel {
say [Hello!] for (2) secs
}{
play note (60) for (0.25) beats
}{
rest for (0.0625) beats
play note (72) for (0.25) beats
} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ @delInput @addInput::control

or, if growable C-blocks aren't possible:
with this one the problem is that blocks stacked together are expected to wait for each other, so maybe convert the blocks dropped in it into cap blocks
run in parallel {
say [Hello!] for (2) secs::cap
play note (60) for (0.25) beats::cap
if <(50)=(50)> then {
rest for (0.0625) beats
play note (72) for (0.25) beats
}::control cap
}::control
VedanshS933
Scratcher
1000+ posts

All at Once/Run in Parallel Block

nembence wrote:

VedanshS933 wrote:

(#63)

medians wrote:

Can you somehow change the block name or something so it doesn't get confused with the 2.0 alpha all at once block?

You could suggest one. I don't have any ideas
What about this?
run in parallel {
say [Hello!] for (2) secs
}{
play note (60) for (0.25) beats
}{
rest for (0.0625) beats
play note (72) for (0.25) beats
} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ @delInput @addInput::control

or, if growable C-blocks aren't possible:
with this one the problem is that blocks stacked together are expected to wait for each other, so maybe convert the blocks dropped in it into cap blocks
run in parallel {
say [Hello!] for (2) secs::cap
play note (60) for (0.25) beats::cap
if <(50)=(50)> then {
rest for (0.0625) beats
play note (72) for (0.25) beats
}::control cap
}::control

The name is nice. \

Last edited by VedanshS933 (Feb. 16, 2025 16:00:34)

VedanshS933
Scratcher
1000+ posts

All at Once/Run in Parallel Block

bump
VedanshS933
Scratcher
1000+ posts

All at Once/Run in Parallel Block

bump
VedanshS933
Scratcher
1000+ posts

All at Once/Run in Parallel Block

bump
VedanshS933
Scratcher
1000+ posts

All at Once/Run in Parallel Block

bump
VedanshS933
Scratcher
1000+ posts

All at Once/Run in Parallel Block

bump
BringUpYourPost
Scratcher
500+ posts

All at Once/Run in Parallel Block

Threading might lead to data races.
For example, after running this script, what would foo be?
set [foo v] to [1]
run in parallel {
set [foo v] to ((foo) * (3))
}{
set [foo v] to ((foo) + (1))
}
Would it be 1*3 +1 = 4 or (1 +1) * 3 = 6

Last edited by BringUpYourPost (Aug. 28, 2025 00:28:20)

Haycat2009
Scratcher
100+ posts

All at Once/Run in Parallel Block

VedanshS933 wrote:

This is not a duplicate because this launches two blocks at once and not run a block with run without screen refresh.

Hi!
I am proposing an All at Once or Run in Parallel block. This block would be used to run two or more blocks at once.
If you are thinking that scrtips cannot be run together, only once, then please check the workaround.

Mockup

All at Once {

} :: control
or

Run in Parallel {

} :: control

Workaround

script
broadcast [hi v]

when I receive [hi v]
say [hi]

when I receive [hi v]
think [hi]

Scratch On!

Post rewritten on 26th February 2025

Shouldnt run in parallel be an E block like this:
Run in parallel{
Script 1
}and{
Script 2
}::control

Last edited by Haycat2009 (Aug. 28, 2025 01:24:11)

VedanshS933
Scratcher
1000+ posts

All at Once/Run in Parallel Block

BringUpYourPost wrote:

Threading might lead to data races.
For example, after running this script, what would foo be?
set [foo v] to [1]
run in parallel {
set [foo v] to ((foo) * (3))
}{
set [foo v] to ((foo) + (1))
}
Would it be 1*3 +1 = 4 or (1 +1) * 3 = 6
Yes, that could happen. I'd have to check.

Haycat2009 wrote:

VedanshS933 wrote:

-snip-
OP was posted

Shouldnt run in parallel be an E block like this:
Run in parallel{
Script 1
}and{
Script 2
}::control
It could be.

Last edited by VedanshS933 (Aug. 28, 2025 10:29:11)

not-k7e
Scratcher
71 posts

All at Once/Run in Parallel Block

VedanshS933 wrote:

BringUpYourPost wrote:

Threading might lead to data races.
For example, after running this script, what would foo be?
set [foo v] to [1]
run in parallel {
set [foo v] to ((foo) * (3))
}{
set [foo v] to ((foo) + (1))
}
Would it be 1*3 +1 = 4 or (1 +1) * 3 = 6
Yes, that could happen. I'd have to check.

It will happen I just gave an example.

Powered by DjangoBB