0

I am creating a Postgres C extension that is a parallelized aggregate function. Is there any way I can share the state, or any any state/memory-block I choose, among all the workers? I dont want each worker process to have its own copy, I want a global copy for everyone.

Any help would be greatly appreciated.

3
  • I would create a shared memory segment. You have to make sure that the area is destroyed afterwards (even if there is an error or other interruption), else you will leak memory. Commented Oct 19, 2020 at 6:03
  • May I get an example please? Commented Oct 19, 2020 at 6:04
  • Register an "at exit" function. I cannot be bothered to write an aggregate function in C. Commented Oct 19, 2020 at 6:15

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.