Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ecs_query_changed to be useable in multithread! #852

Open
deus369 opened this issue Nov 2, 2022 · 0 comments
Open

ecs_query_changed to be useable in multithread! #852

deus369 opened this issue Nov 2, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@deus369
Copy link

deus369 commented Nov 2, 2022

Describe the problem you are trying to solve.

I found a good way to trigger system functions when changes occur in the components with ecs_query_changed and inserted filters. I have workable code for that. However it only runs in single threaded system. Primarily with ecs_query_changed(NULL, it). Apparently it works with ecs_query_changed(changeQuery, NULL).

The error that spits out is:

fatal: flecs.c: fatalfatalfatal: flecs.c: 48290: fatalfatalfatal: flecs.c: 48290: assert: it->next == ecs_query_next INVALID_PARAMETER
fatal: fatal: flecs.cfatal: flecs.c: fatalfatal: flecs.c: : 48290: fatalfatal: flecs.c: 48290: assert: it->next == ecs_query_next INVALID_PARAMETER48290: assert: it->next == ecs_query_next INVALID_PARAMETER: flecs.c: fatal: flecs.c: assert: it->next == ecs_query_next INVALID_PARAMETER48290: assert: it->next == ecs_query_next INVALID_PARAMETER
assert: it->next == ecs_query_next INVALID_PARAMETER

Also ecs_query_skip(it) does not work in multi-threading. The error it spits out is:

fatal: flecs.c: 48335: assert: it->next == ecs_query_next INVALID_PARAMETER
fatal: flecs.cfatal: flecs.c: : fatal: flecs.c: fatal: flecs.c: fatal: flecs.c: fatal: flecs.c: fatal: flecs.c: fatal: flecs.c: fatal: flecs.c: fatal: flecs.c: fatal: flecs.c: 48335: assert: it->next == ecs_query_next INVALID_PARAMETER
48335: 48335: assert: it->next == ecs_query_next INVALID_PARAMETER
fatal: flecs.c: fatal: flecs.c: assert: it->next == ecs_query_next INVALID_PARAMETER48335: 48335: fatalassert: it->next == ecs_query_next INVALID_PARAMETER48335: 48335: 48335: assert: it->next == ecs_query_next INVALID_PARAMETER
48335: 48335: fatal: flecs.c: 48335: assert: it->next == ecs_query_next INVALID_PARAMETER
fatal: flecs.c: assert: it->next == ecs_query_next INVALID_PARAMETER
48335: assert: it->next == ecs_query_next INVALID_PARAMETER
assert: it->next == ecs_query_next INVALID_PARAMETER
: flecs.c: assert: it->next == ecs_query_next INVALID_PARAMETER
48335: assert: it->next == ecs_query_next INVALID_PARAMETER
assert: it->next == ecs_query_next INVALID_PARAMETER
fatal
48335: assert: it->next == ecs_query_next INVALID_PARAMETER
fatalfatalfatal: flecs.c: 48335: 48335: assert: it->next == ecs_query_next INVALID_PARAMETER
: flecs.c: : flecs.c48335: assert: it->next == ecs_query_next INVALID_PARAMETER
: flecs.c: 48335: assert: it->next == ecs_query_next INVALID_PARAMETER
assert: it->next == ecs_query_next INVALID_PARAMETER
assert: it->next == ecs_query_next INVALID_PARAMETER
fatal: flecs.c: : 48335: fatalassert: it->next == ecs_query_next INVALID_PARAMETER48335: assert: it->next == ecs_query_next INVALID_PARAMETERfatal: 

: 
flecs.c: 48335: flecs.cassert: it->next == ecs_query_next INVALID_PARAMETER./zoxel-dev.x86(+0x32917) [0x55a4bf6fe917]

Describe the solution you'd like

I would like to run this function ecs_query_changed and ecs_query_skip in multi-thread so when I scale up my systems they can take full advantage of my 24 core cpu, or my 6 core cpu on my linux phone.

@deus369 deus369 added the enhancement New feature or request label Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant