kaist-cp / cs431

1.42k stars 135 forks source link

[Homework] HW6 Retiree Inner #283

Closed Jaegoomon closed 3 years ago

Jaegoomon commented 3 years ago

Hi.

As far as I understand, in Retirees.inner threads access the Vec<> to free hazard pointer. So I think that I have to control accesses atomically because two more thread can access inner: Vec<> concurrently. But is it possible to control atomically Vector type? Do I have to make my own api such as cas operation or something?

And also, I wonder if the atomic fence is really needed. Is it necessary to implement to this project?

tomtomjhj commented 3 years ago

two more thread can access inner: Vec<> concurrently

No. Each thread has its own Retirees (note thread_local! in mod.rs), and all of its method take &mut self.

I wonder if the atomic fence is really needed.

Yes

tomtomjhj commented 3 years ago

I wonder if the atomic fence is really needed.

This is briefly mentioned in the lecture but I think the explanation wasn't enough, so I'll post more detailed explanations soon.