tag:blogger.com,1999:blog-2791269644974861305.post5198100096144474721..comments2016-04-19T07:10:45.583-07:00Comments on Thoughts: Remishttp://www.blogger.com/profile/00895612536236236632noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-2791269644974861305.post-38540320964089007342016-04-19T07:10:22.416-07:002016-04-19T07:10:22.416-07:00Thanks for writing this article and the updated bu...Thanks for writing this article and the updated bug free version.Shubhenduhttps://www.blogger.com/profile/05601097730350072528noreply@blogger.comtag:blogger.com,1999:blog-2791269644974861305.post-49320903226084441742012-09-24T09:50:11.057-07:002012-09-24T09:50:11.057-07:00Why to swap the buffers instead of just passing th...Why to swap the buffers instead of just passing the dirty to the clean one and the clean to the snap?Felipehttps://www.blogger.com/profile/04343122206965264506noreply@blogger.comtag:blogger.com,1999:blog-2791269644974861305.post-43850335918260401302012-02-08T15:42:20.812-08:002012-02-08T15:42:20.812-08:00Well, IMHO this not the point of the solution. The...Well, IMHO this not the point of the solution. The mechanism must allow for safe concurrent behaviour and this is provided. Now next layer can be added to provide some identification of the "messages" e.g. some incremented ID inside data.Andrzej Polanskihttps://www.blogger.com/profile/00864521452526949146noreply@blogger.comtag:blogger.com,1999:blog-2791269644974861305.post-86835354401300449272012-02-08T15:00:48.723-08:002012-02-08T15:00:48.723-08:00That's a better solution that my Part I implem...That's a better solution that my Part I implementation, but you don't solve the problem I fix in Part II - that is if you call the snap method twice you snap a new value and then snap the old value again...Remishttps://www.blogger.com/profile/01809415376303436250noreply@blogger.comtag:blogger.com,1999:blog-2791269644974861305.post-42983652657226519192012-02-08T13:31:33.956-08:002012-02-08T13:31:33.956-08:00Do you mean sth like this:
#define TRIPLE_BUFFER_...Do you mean sth like this:<br /><br />#define TRIPLE_BUFFER_FLIP_WRITER(BUFFER) \<br /> BUFFER.dirty = __sync_lock_test_and_set(&BUFFER.clean, BUFFER.dirty);<br /><br />#define TRIPLE_BUFFER_NEW_SNAP(BUFFER) \<br /> BUFFER.snap = __sync_lock_test_and_set(&BUFFER.clean, BUFFER.snap);<br /><br />Regards :)Andrzej Polanskihttps://www.blogger.com/profile/00864521452526949146noreply@blogger.comtag:blogger.com,1999:blog-2791269644974861305.post-62647679354864423382012-01-29T17:40:36.347-08:002012-01-29T17:40:36.347-08:00I recently implemented something similiar…involvin...I recently implemented something similiar…involving database tables. An unbounded number of writers are allowed to insert rows into table A. A periodic process locks table A briefly and does a swap/rename of A to TEMP and B to A and TEMP to B. That process then releases the lock and processes the contents of B.JPhttps://www.blogger.com/profile/14985302852355510033noreply@blogger.com