On Thu, Dec 20, 2018 at 12:17 AM Chris M. Thomasson <cris...@charter.net> wrote:
>
> On Wednesday, December 19, 2018 at 2:02:31 AM UTC-8, Dmitry Vyukov wrote:
>>
>> On Wed, Dec 19, 2018 at 7:05 AM Chris M. Thomasson <cri...@charter.net> 
>> wrote:
>> >
>> > On Monday, December 17, 2018 at 11:23:20 PM UTC-8, Chris M. Thomasson 
>> > wrote:
>> >>
>> >> If interested, I can give more details. For now, here is the code in the 
>> >> form of a Relacy Test Unit:
>>
>> Can you give a short executive summary? What are the
>> advantages/disadvantages/novelty?
>
>
> Very quick, sorry: Should have some more time tonight.
>
> A simple proxy with per-thread mutexes. Threads enter a protected region by 
> taking their own lock, and leave it by releasing said lock. Very basic. When 
> a thread wants to defer a node for deletion it pushes it onto a global 
> lock-free stack via CAS. There is a reaper thread that flushes all of the 
> nodes with XCHG, and keeps it on an internal list. The reaper thread loop 
> then tries to acquire and release all of the per-thread locks. Once it has 
> done this, it says quiescent state. It keeps nodes in a way that ensures at 
> least two periods of this state have occurred before it actually calls delete 
> and destroys memory. Since the reapers use a try_lock to detect a quiescent 
> state, it can livelock in a reaper in the sense that it never gains a lock. 
> However, Relacy should never detect the condition because of the limited 
> iteration loop for workers wrt the test code itself. There is a work around. 
> We can let a reaper fail for a little while before it actually ditches 
> try_lock and just locks the per-thread quiescence lock. It would act just 
> like an adaptive mutex, in a sense...

So the main advantage is simplicity and ability for mere mortals to
understand how it works :)
Should be especially advantageous in teaching since it does not
involve atomic operations.


> _______________
> fresh = new generation
> old = old generation
>
> // reaper loop
>
> fresh = gain new nodes
>
> if (quiescent)
> {
>     dump = old;
>     old = fresh;
>     fresh = empty;
>
>     dump.destroy(); // reclaim memory...
> }
> _______________
>
>
>>
>>
>>
>> >> https://pastebin.com/raw/FpnvTqvM
>> >> (raw link, no ads! :^)
>> >>
>> >> ___________________________
>> >>
>> >> [...]
>> >>
>> >> ___________________________
>> >>
>> >>
>> >>
>> >> Can anybody run it with Relacy? If not, I need to learn why: what 
>> >> problems were encountered?
>>
>> Did you succeed with running it with Relacy? :)
>
>
> So far, so good. It passes 10000000 iterations. I am letting rl::sched_bound 
> run for around 65 minutes now, no problems at iteration:
>
>
> 99% (129564672/129564673)
>
> 99% (129630208/129630209)
>
> 99% (129695744/129695745)
>
> 99% (129761280/129761281)
>
> 99% (129826816/129826817)
>
> 99% (129892352/129892353)
>
> 99% (129957888/129957889)
>
> 99% (130023424/130023425)
>
> [...]
>
>
>
> Also, need to get the latest version of Relacy. I am using version: 2.3.
>
>
> Does it bite the dust in the latest version? ;^o

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Scalable Synchronization Algorithms" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to lock-free+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/lock-free/CAEeQi3tX6jE3nE5_X%2Bj_i10%3DWkYu6CqSgOhVw545RcRW%2BKPZBg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to