On 8/5/06, Srivatsa Vaddagiri <[EMAIL PROTECTED]> wrote: > On Fri, Aug 04, 2006 at 07:56:03PM -0700, Paul Menage wrote: > > What's the recommended safe way to access current->res_group (or even > > an arbitrary task->res_group) without racing against a concurrent > > set_res_group() call from a different process? > > I guess as long as we have done a kref_get() on ->res_group, we are safe > to access it.
But currently I don't even see a safe way of calling kref_get() on current->res_group - there's a small race with someone deleting the res_group which could lead you to take a reference on an already-deleted object. > > We can use RCU if we can assume that the readers wont block, while they > are dereferencing task->res_group. Readers that need to block can take a proper reference on the group, so that at least they know it won't go away. Paul ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ ckrm-tech mailing list https://lists.sourceforge.net/lists/listinfo/ckrm-tech