Static variables and parallelism in query modules

To create a global context one should create a static variable within its query module. However, handling parallelism with static variables can be error-prone. Is there going to be a Memgraph-aware global context that won’t kill the execution once a user makes mistake in developing a multi-threaded module?

Could you please give an example of what exactly do you mean?

We decided not to provide support for multithreaded utilities directly because it would be mostly wrapping up the things from STL, and POSIX. We would only provide a limited functionality that way and force the user to use our functions instead of something they are familiar with.

I meant the implementation of thread-safe global query module context that users would be able to access without caring about parallelism issues.

We really had a hard discussion about that and we ended up with the conclusion that the users can do that on their own in the way they find the best for their use case. We would be just wrapping up some existing solutions as I already mentioned with limited API.

Also, users can include any other lib they see fit, python and C++, so there is no need to implement from scratch some of those things.

1 Like