lkml.org 
[lkml]   [2005]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] New operation for kref to help avoid locks
Corey Minyard wrote:
> Nick Piggin wrote:

>> Is get_with_check actually going to be useful for anything? It
>> seems like it promotes complex and potentially unsafe schemes.
>
>
> It is certainly more complex to use this, and I'm guessing that's why
> Greg rejected it. Certainly a valid problem.
>
>>
>> eg. In your queue example, it would usually be better to have
>> a refcount for being on queue, and entry_completed would remove
>> the entry from the queue and accordingly drop the refcount. The
>> release function would then just free it.
>
>
> True. But if things picked up entries of the queue and incremented
> their refcount, then you would need a lock. The same technique would
> apply. But your example would be the more common one, I would think.
>

Well, but you take a lock in your system too, to protect the
queue (ie. in get_working_entry()).

Nick


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:10    [W:0.099 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site