Skip to content

Commit

Permalink
Add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
marioskogias committed Oct 4, 2024
1 parent 2287301 commit 45e9371
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/rt/sched/behaviourcore.h
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,10 @@ namespace verona::rt
Logging::cout() << " Reader got the cown " << *new_slot
<< Logging::endl;
yield();

// TODO: This will not be correct in the multi-schedule cases.
// There needs to be a check that ensures the chain contains only
// reads. This will be calculated in the prepare phase.
new_slot->set_read_available();
ec[first_body_index]++;
if (first_reader)
Expand Down Expand Up @@ -908,6 +912,8 @@ namespace verona::rt
Logging::cout() << "Setting slot " << slot << " to ready"
<< Logging::endl;
slot->set_ready();

// TODO: We chould also set the READ_AVAILABLE here
}

// Fourth phase - Process & Resolve
Expand All @@ -926,6 +932,9 @@ namespace verona::rt
{
if (curr_slot->is_read_only())
{
// TODO: To revisit and simplify after adding support for
// multi-sched readonly. This part of the code will look closer
// to release.
yield();
bool first_reader = cown->read_ref_count.add_read();
Logging::cout() << "Reader at head of queue and got the cown "
Expand Down Expand Up @@ -956,7 +965,6 @@ namespace verona::rt
Logging::cout() << " Writer waiting for previous readers cown "
<< *curr_slot << Logging::endl;
yield();
// Was this a bug in the previous implementation?
cown->next_writer = first_body;
}
else
Expand Down

0 comments on commit 45e9371

Please sign in to comment.