Yes, I probably need some kind of mutex, but I was wondering if it would be enough with some memory barrier, since read and write operations in modern computers are usually atomics. What I pretend to do is that everytime I read one element from the list, the function changes the "head pointer" with the next element , so the next time the function is called, it will return the next element. When the list reach the last element, it starts again from the beggining. The function should somehow remember the last extracted element each time and consecutively return the next one. I could probably use a counter and iterate the list looking for the next element, but it would be hard to maintain when some elements are added or deleted. Best regards 2011/6/22 Johannes Berg <johannes@xxxxxxxxxxxxxxxx>: > On Wed, 2011-06-22 at 13:54 +0200, Manuel Sáez wrote: >> Thank you for your answer. I have actually read some articles like this ones: >> >> http://lwn.net/Articles/262464/ >> http://lwn.net/Articles/263130/ >> >> I think I understood how I should normally use it, but not how it >> really works. I found lots of code snippets in internet and it seems >> to be very easy to use, but when I try to get more information it gets >> more complicated. Although the code is wrong, do you think it could be >> possible what I want to do? I mean, could it be possible in theory to >> "shift" the header in order to make a ring buffer. > > I haven't understood what you want to do, but "shifting" anything would > seem to me to be a write operation. > > johannes > > -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html