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

Fix possible deadlock in neuron update loop in multithreaded code (fixes #718) #734

merged 1 commit into from May 29, 2017


Copy link

@heplesser heplesser commented May 26, 2017

This PR fixes a potential deadlock when a neuron throws an exception during multithreaded simulation (#718).

Since it is difficult to test for deadlocks in unittests, there is no automated test. This manual test is inspired by @maharjun's deadlock module. To test, add the following to the beginning of iaf_psc_alpha::update():

 if ( this->get_thread() == 2 )
	  throw KernelException("Thread 2");

and run the following SLI script from a file

0 << /local_num_threads 4 >> SetStatus
/iaf_psc_alpha 10 Create ;
10 Simulate

NEST should hang if you use current master; with the correction given here, NEST should terminate with an error message.

@maharjun Would you test and review this fix?

Copy link

@maharjun maharjun commented May 28, 2017

I have tested it and can confirm that this works correctly.

Copy link

@sanjayankur31 sanjayankur31 left a comment

Looks OK to me. 👍

Copy link
Contributor Author

@heplesser heplesser commented May 29, 2017

Merging as tests pass and two reviewers confirmed that the deadlock no longer occurs.

@heplesser heplesser merged commit 0a0d2f2 into nest:master May 29, 2017
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
@heplesser heplesser deleted the heplesser:fix-718-deadlock branch May 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.