Changeset 3178 in Sophya for trunk/SophyaProg
- Timestamp:
- Feb 6, 2007, 3:05:52 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaProg/Tests/zthr.cc
r3177 r3178 96 96 // Structure de gestion utilisee par la classe MTVecPool 97 97 typedef struct { 98 TVector<int_8> vv; 98 99 bool busy; 99 100 int stat; … … 119 120 ~MTVecPool() { } 120 121 // Renvoie un pointeur de vecteur pour thread tid 121 TVector<int_8> GetVec(uint_4 tid, uint_4& idx)122 TVector<int_8>* GetVec(uint_4 tid, uint_4& idx) 122 123 { 123 124 if (tid >= _nth) ParmError("MTVecPool::getvec() tid > _nth"); … … 127 128 St_VecPool stv; 128 129 idx = _vecs.size(); 130 stv.vv = _vmx.Column(idx); 129 131 stv.busy = true; 130 132 stv.stat = 0; 131 133 _vecs.push_back(stv); 132 134 mex.unlock(); 133 //DBG cout << "DBG-GetVec(tid= " << tid << ") -> Idx=" << idx << " VecSz=" << _vmx.Column(idx).Size() << endl;134 return ( _vmx.Column(idx));135 //DBG cout << "DBG-GetVec(tid= " << tid << ") -> Idx=" << idx << " VecSz=" << &(_vecs[idx].vv) << endl; 136 return (&(_vecs[idx].vv)); 135 137 } 136 138 else { … … 148 150 mex.unlock(); 149 151 //DBG cout << "DBG-GetVec(tid= " << tid << ") -> nv=" << hex << rv << dec << endl; 150 return ( _vmx.Column(idx));152 return (&(_vecs[idx].vv)); 151 153 } 152 154 else { … … 158 160 } 159 161 160 // Retourne l e pointeur devecteur au gestionnaire, qui le marque comme disponible162 // Retourne l'index du vecteur au gestionnaire, qui le marque comme disponible 161 163 void RetVec(uint_4 idx) 162 164 { … … 182 184 nerr++; 183 185 } 184 _v mx.Column(k)-= sum;185 _v mx.Column(k).MinMax(min, max);186 _vecs[k].vv -= sum; 187 _vecs[k].vv.MinMax(min, max); 186 188 if ((min!=0) || (max!=0)) { 187 189 cout << " Check()/Pb vec[k=" << k << "] != (sum=" << sum << ")" << endl; … … 225 227 uint_4 idx; 226 228 for(k=0; k<L; k++) { 227 mtvp->GetVec(tid, idx) += p2;229 *(mtvp->GetVec(tid, idx)) += p2; 228 230 //DBG cout << "DBG-sync_funzt(tid=" << tid << ", idx=" << idx << endl; 229 231 mtvp->RetVec(idx);
Note:
See TracChangeset
for help on using the changeset viewer.