On Wed, 30 Dec 2009, Jérémy Zurcher wrote:

do this
- lock
- moves indexes
- unlock
- memcpy

IMHO it's good enough if the ring size is well ... sized.

The would work... except that you have no indication of when the memcpy is complete. Once the indexes are moved... that signals to the reader-thread that it's OK to read the data (but it's still invalid).

For example:

Thread 1: lock, moves indexes, unlock, memcpy

Thread 2: As Thread 1 starts the memcpy, we start reading the (garbage) data... which we should be able to do since the index moved.

Peace,
Gabriel
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Hydrogen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hydrogen-devel

Reply via email to