{"action":"created","issue":{"url":"https://api.github.com/repos/ofiwg/libfabric/issues/1533","labels_url":"https://api.github.com/repos/ofiwg/libfabric/issues/1533/labels{/name}","comments_url":"https://api.github.com/repos/ofiwg/libfabric/issues/1533/comments","events_url":"https://api.github.com/repos/ofiwg/libfabric/issues/1533/events","html_url":"https://github.com/ofiwg/libfabric/issues/1533","id":120541004,"number":1533,"title":"Mixing of sread() calls with wait set could cause deadlocks","user":{"login":"shefty","id":3967608,"avatar_url":"https://avatars.githubusercontent.com/u/3967608?v=3","gravatar_id":"","url":"https://api.github.com/users/shefty","html_url":"https://github.com/shefty","followers_url":"https://api.github.com/users/shefty/followers","following_url":"https://api.github.com/users/shefty/following{/other_user}","gists_url":"https://api.github.com/users/shefty/gists{/gist_id}","starred_url":"https://api.github.com/users/shefty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shefty/subscriptions","organizations_url":"https://api.github.com/users/shefty/orgs","repos_url":"https://api.github.com/users/shefty/repos","events_url":"https://api.github.com/users/shefty/events{/privacy}","received_events_url":"https://api.github.com/users/shefty/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-12-05T08:42:30Z","updated_at":"2016-01-14T18:05:14Z","closed_at":null,"body":"If a CQ is configured to use a wait set, and an application calls fi_cq_sread and fi_wait simultaneously, the resulting behavior could result in a deadlock, or at least be undefined, based on the underlying implementation.  The issue is that the app has two threads waiting on the same wait object, and it is unclear which thread would be signaled if an event occurs.  A similar problem occurs with the EQ.\r\n\r\nIf a CQ/EQ is used with a wait set, then the intent is for the application to use fi_wait when blocking.  It is unlikely that an app would also use the sread derivatives.\r\n\r\nWe can either document that the sread calls not be used if a wait set is associated with a CQ/EQ.  This is similar to associating the CQ/EQ with no wait object.  Or we can document that the behavior of calling sread and wait simultaneously is undefined."},"comment":{"url":"https://api.github.com/repos/ofiwg/libfabric/issues/comments/171724629","html_url":"https://github.com/ofiwg/libfabric/issues/1533#issuecomment-171724629","issue_url":"https://api.github.com/repos/ofiwg/libfabric/issues/1533","id":171724629,"user":{"login":"goodell","id":78560,"avatar_url":"https://avatars.githubusercontent.com/u/78560?v=3","gravatar_id":"","url":"https://api.github.com/users/goodell","html_url":"https://github.com/goodell","followers_url":"https://api.github.com/users/goodell/followers","following_url":"https://api.github.com/users/goodell/following{/other_user}","gists_url":"https://api.github.com/users/goodell/gists{/gist_id}","starred_url":"https://api.github.com/users/goodell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goodell/subscriptions","organizations_url":"https://api.github.com/users/goodell/orgs","repos_url":"https://api.github.com/users/goodell/repos","events_url":"https://api.github.com/users/goodell/events{/privacy}","received_events_url":"https://api.github.com/users/goodell/received_events","type":"User","site_admin":false},"created_at":"2016-01-14T18:05:14Z","updated_at":"2016-01-14T18:05:14Z","body":"OK, I see the savings possible from this restriction (making sread the only thing that resets the wait obj).  So I think that means two things need to be figured out still:\r\n\r\n1. How do we describe all this wait set / wait obj / sread usage to users in a clear manner?\r\n2. How should the `fi_dgram_waitset` test change to reflect the clarified rules?  Just replace the existing call to `fi_cq_read` with `fi_cq_sread`?"}}