On Mon, Oct 31, 2011 at 7:44 AM, sparsh mittal <[email protected]>wrote:
> Hello
>
> Here is a piece of code from cacheController.cpp
>
> bool CacheController::handle_interconnect_cb(void* arg)
> {
> ...................
> /*
> * We are going to access the cache later, to make
> * sure that this entry is not cleared enable the
> * cache access event flag of this entry
> */
> queueEntry->eventFlags[CACHE_ACCESS_EVENT]++;
>
> .......
>
> /* Check dependency and access the cache */
> CacheQueueEntry* dependsOn = find_dependency(msg->request);
>
> if (dependsOn)
> {
>
> dependsOn->depends = queueEntry->idx;
> ////Then stats are updated
> }
> else
> {
> cache_access_cb(queueEntry);
> }
> .......
> }
>
> My question is: If dependsOn is true, cache_access_cb is not called,
> although the flag is set. Does it create error?
>
>
> The flag is used to indicate that pending entry is still waiting for some
action so it will not be deleted by 'clear_entry_cb' function. By setting
'CACHE_ACCESS' flag we indicate that this entry is waiting for
'cache_access'.
The reason for adding these flags was because we allow multiple actions
done in parallel for same pending request, we need to make sure that all
the actions are completed before we remove that entry. So when we add an
entry to dependent list we set the flag so that entry won't be cleared by
any other action. Also this flags help in debugging the code, we can see
which flag is set to find out what action this entry is waiting for.
- Avadh
>
> Thanks and Regards
> Sparsh Mittal
>
>
>
> _______________________________________________
> http://www.marss86.org
> Marss86-Devel mailing list
> [email protected]
> https://www.cs.binghamton.edu/mailman/listinfo/marss86-devel
>
>
_______________________________________________
http://www.marss86.org
Marss86-Devel mailing list
[email protected]
https://www.cs.binghamton.edu/mailman/listinfo/marss86-devel