Parallel Scheduler - Parallel lua made easy and performant

Great Module! Running into one issue with it, though. I’m getting this error:
image

Which is linked to this line right here
image

Based off some debugging I attempted, it seems that after the RemainingTasks hits 2 (red circle), something isn’t cleared and the script still assumes there are 2 tasks and tries to assign them (blue circle). The WorkParmeters for that WorkerId doesn’t exist though so it just errors.

This error will contine to popup for subsequent :Work() requests.

Everything still will work as intended though so I can kinda just ignore it.

1 Like

Well that’s dumb lol. I never considered the case where there are more actors than tasks to run XD

This happens when you Schedule and run more tasks (for example 4), then less tasks (but lower than DEFAULT_MAX_WORKERS, ex. 2), 4 actors were created previously, but only 2 have tasks to run, causing the error

image
The fix is simply to return if there are no params (aka no tasks) for the actor. This is what was (implicitly) happening when you encountered the error, which explains why the module kept working as expected
There might be another, more performant, fix to prevent the excess actors from running in the first place, I might look into it some day

This is also why I didn’t bother to really test this fix thoroughly cuz I’m lazy, so let me know if there are other errors

The roblox Model and the Place have been updated with this fix

Alrighty, thanks for the fix! I’ll keep you updated
Awesome work man :smile:

1 Like