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
merged 1 commit into from May 29, 2017

Conversation

Projects
None yet
3 participants
@heplesser
Contributor

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?

@maharjun

This comment has been minimized.

Show comment
Hide comment
@maharjun

maharjun May 28, 2017

Contributor

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

Contributor

maharjun commented May 28, 2017

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

@sanjayankur31

Looks OK to me. 👍

@heplesser

This comment has been minimized.

Show comment
Hide comment
@heplesser

heplesser May 29, 2017

Contributor

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

Contributor

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

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@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