Skip to content

Avoid multi-threaded auto-commit #36

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

Closed
wants to merge 12 commits into from
Closed

Conversation

mahendra
Copy link
Collaborator

Note: This is done on top of #33

This is done using shared memory objects provided by multiprocessing.

Design

  • We start a commit process which waits on a multiprocessing.Queue with timeout = auto_commit_every_t
  • In the main proc, when _auto_commit triggers a commit, we send a message on the queue
  • The commit proc wakes up and does a commit
  • If timeout is not None, then the commit proc will wake up after the specified timeout and to the commit.
  • Data is shared between both procs using shared memory.
  • We avoid the use of Locks completely

Also fix a bug in auto-commit for - auto_commit_every_n

This is done using shared memory objects provided by multiprocessing.
Also fix a bug in auto-commit for - auto_commit_every_n
@mahendra mahendra mentioned this pull request Jun 30, 2013
@mumrah
Copy link
Collaborator

mumrah commented Oct 3, 2013

@mahendra now that we have CI and the test are working again, can you rebase your changes and add some tests?

@mahendra
Copy link
Collaborator Author

mahendra commented Oct 4, 2013

sure. working on it.

@mahendra mahendra mentioned this pull request Oct 4, 2013
@mahendra
Copy link
Collaborator Author

mahendra commented Oct 4, 2013

This works now, but then commit will stop working in windows because of the issue mentioned in #46. do review this and let me know if it is ready for merge. Will keep it on hold till we sort out #46. Then we can commit both together.

@mahendra
Copy link
Collaborator Author

mahendra commented Oct 8, 2013

@mumrah I have re-arranged the code so that it will work in windows. The trick is in ensuring that the target parameter passed to multiprocessing.Process is a normal function.

Do have a look and let me know.

@rdiomar
Copy link
Collaborator

rdiomar commented Jan 30, 2014

The problem we have with forking long-running python processes is that the child can potentially have the same memory footprint as the parent, which can be pretty large.

@dpkp
Copy link
Owner

dpkp commented Jun 12, 2015

Closing inactive PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants