< prev index next >

src/share/vm/memory/sharedHeap.hpp

Print this page




  96 //  The active_workers is not reset to 0 after a parallel phase.  It's
  97 //  value may be used in later phases and in one instance at least
  98 //  (the parallel remark) it has to be used (the parallel remark depends
  99 //  on the partitioning done in the previous parallel scavenge).
 100 
 101 class SharedHeap : public CollectedHeap {
 102   friend class VMStructs;
 103 
 104   friend class VM_GC_Operation;
 105   friend class VM_CGC_Operation;
 106 
 107 protected:
 108   // If we're doing parallel GC, use this gang of threads.
 109   FlexibleWorkGang* _workers;
 110 
 111   // Full initialization is done in a concrete subtype's "initialize"
 112   // function.
 113   SharedHeap();
 114 
 115 public:
 116   // A SharedHeap will contain some number of spaces.  This finds the
 117   // space whose reserved area contains the given address, or else returns
 118   // NULL.
 119   virtual Space* space_containing(const void* addr) const = 0;
 120 
 121   // Note, the below comment needs to be updated to reflect the changes
 122   // introduced by JDK-8076225. This should be done as part of JDK-8076289.
 123   //
 124   //Some collectors will perform "process_strong_roots" in parallel.
 125   // Such a call will involve claiming some fine-grained tasks, such as
 126   // scanning of threads.  To make this process simpler, we provide the
 127   // "strong_roots_parity()" method.  Collectors that start parallel tasks
 128   // whose threads invoke "process_strong_roots" must
 129   // call "change_strong_roots_parity" in sequential code starting such a
 130   // task.  (This also means that a parallel thread may only call
 131   // process_strong_roots once.)
 132   //
 133   // For calls to process_roots by sequential code, the parity is
 134   // updated automatically.
 135   //
 136   // The idea is that objects representing fine-grained tasks, such as
 137   // threads, will contain a "parity" field.  A task will is claimed in the
 138   // current "process_roots" call only if its parity field is the
 139   // same as the "strong_roots_parity"; task claiming is accomplished by
 140   // updating the parity field to the strong_roots_parity with a CAS.




  96 //  The active_workers is not reset to 0 after a parallel phase.  It's
  97 //  value may be used in later phases and in one instance at least
  98 //  (the parallel remark) it has to be used (the parallel remark depends
  99 //  on the partitioning done in the previous parallel scavenge).
 100 
 101 class SharedHeap : public CollectedHeap {
 102   friend class VMStructs;
 103 
 104   friend class VM_GC_Operation;
 105   friend class VM_CGC_Operation;
 106 
 107 protected:
 108   // If we're doing parallel GC, use this gang of threads.
 109   FlexibleWorkGang* _workers;
 110 
 111   // Full initialization is done in a concrete subtype's "initialize"
 112   // function.
 113   SharedHeap();
 114 
 115 public:





 116   // Note, the below comment needs to be updated to reflect the changes
 117   // introduced by JDK-8076225. This should be done as part of JDK-8076289.
 118   //
 119   //Some collectors will perform "process_strong_roots" in parallel.
 120   // Such a call will involve claiming some fine-grained tasks, such as
 121   // scanning of threads.  To make this process simpler, we provide the
 122   // "strong_roots_parity()" method.  Collectors that start parallel tasks
 123   // whose threads invoke "process_strong_roots" must
 124   // call "change_strong_roots_parity" in sequential code starting such a
 125   // task.  (This also means that a parallel thread may only call
 126   // process_strong_roots once.)
 127   //
 128   // For calls to process_roots by sequential code, the parity is
 129   // updated automatically.
 130   //
 131   // The idea is that objects representing fine-grained tasks, such as
 132   // threads, will contain a "parity" field.  A task will is claimed in the
 133   // current "process_roots" call only if its parity field is the
 134   // same as the "strong_roots_parity"; task claiming is accomplished by
 135   // updating the parity field to the strong_roots_parity with a CAS.


< prev index next >