#parallel question

1 messages · Page 1 of 1 (latest)

dusty gorge
#

soo 8 actors -> under heartbeat does work for 5ms

#

should all execute at same time righttt

fringe fog
#

roblox handles that whoknows

#

is it on server?

dusty gorge
#

yes server

#

i believe everything in parallel under heartbeat runs at same time

glad wave
#

Ask hao, he is good with parallel stuff

dusty gorge
#

so am confused on how it would load balance

dusty gorge
glad wave
#

Why not try it?

dusty gorge
fringe fog
dusty gorge
#

so it would have to put the 8 at

#

4 each core

#

question is, would it run one after another? all at same time?

fringe fog
dusty gorge
# fringe fog

@lime cedar ik u hate me already but is this still true?

#

and is it main thread + 2 ? or its main thread + 1

timid veldt
dusty gorge
#

on each actor

#

then just loop that does some stuff for exacly 5ms

#

timed

weary nymph
weary nymph
weary nymph
dusty gorge
#

i was told that

#

heartbeat:ConnectParallel

#

i also delayed

#

if main thread does something under heartbeat

#

so only after main is done, it will fire heartbeat in parallel

#

is that true

weary nymph
#

I don't know that case, you'd have to test it yourself

dusty gorge
#

fair

#

tysm anyways

lime cedar
dusty gorge
dusty gorge
timid veldt
dusty gorge
#

But I assume 2 bars mean 2 threads cores whatever

lime cedar
timid veldt
#

I thought it was 3 workers at ssome point

#

must've decreased

dusty gorge
#

Does it stop loop, do parallel fully and resume

#

Or it constantly jumps between both

dusty gorge
lime cedar
#

then the parallel stuff gets a chance to run

#

thne once thats done the while looo resumes running

dusty gorge
#

I see

#

And about the heartbeat firing late

#

Did I understand that correctly

lime cedar
#

firing late?

dusty gorge
# lime cedar firing late?

I understood (prob wrong); from your messages
That if you got main thread doing stuff under heartbeat
Then heartbeat in actors will fire after that code is ran

dusty gorge
# lime cedar yea

So technically
If I want to run some code, under heartbeat, on main + parallel at same Time, without dropping fps from 60
I should be fine if I;

Use heartbeat and stepped, stepped to detect exact start of frame, then have heartbeat run untill that

But on main thread I'd need to task spawn heartbeat to not prevent parallel from firing

timid veldt
dusty gorge
#

So just 2 workers it is

#

So wait
If only 2 workers
Would it be better to run:
Heavy logic in: parallel (one) and main

Or have 2 actors doing heavy work and main, main doing barely anything (just some remotes, etc)

#

Assuming same workload, just split to either actor and main, vs 2 actors

timid veldt
#

if you're going to have actors, it seems a waste not to have 2 threads doing heavy work concurrently

dusty gorge
#

If 2 workers

#

Then really main thread lives on one, actor on another

#

So using both no?

timid veldt
#

yes, but the main thread would still be idle >90% of the time since you're not running any heavy work on it

#

if a thread is idle, the scheduler can assign a second actor to it

#

@dusty gorge you can test this out by using the microprofiler and debug lib as well

dusty gorge
#

So it will not be idle

#

I just want heavy math on both workers

timid veldt
#

oh, I see. then yes, one actor is fine

#

I just assumed the main thread didn't have any heavy math

dusty gorge
#

but if one actor + main, thats 1 per worker then both gonna do heavy math

#

so just either is fine?

#

or 2+main/1 + main has advantage