On Tue, 03 Jun 2008, Szakáts Viktor wrote:
> Hi Przemek,
> Just a quick note; taking a quick look into the
> common/hbtrace.c code, it doesn't seem MT friendly,
> and it's used all over the code.
Just like many other things below I'm attaching some small
list I extracted from my MT repository copy. It's not full list
and some things are already discarded but it shows part of
problem. Some of items below I've already updated some other
I'll update later. Most of other things which didn't need any
special synchronization mechanisms I've already changed and
this is in current SVN repository.
Also hbtrace will be updated but 1-st I will have to rethink
the form of multi threads logs.
BTW HB_TRACE() is not used in default compilation and fully
stripped so it's used only in custom debug builds.
best regards,
Przemek
*** HVM ***
hvm.c
=====
hb_ulOpcodesCalls \
hb_ulOpcodesTime > profiler
hb_bProfiler /
s_bDebugging \
s_bDebugRequest \
s_pDynsDbgEntry > debugger
s_pFunDbgEntry /
hb_bTracePrgCalls - prg tracing
s_pSymbols \
s_ulFreeSymbols \ PCODE module registering
s_hDynLibID / MUTEX in HB_LIBLOAD()/__HRBLOAD()
s_fCloneSym /
s_pSymStart \
s_pszLinkedMain \
s_VMFlags \
s_VMCancelKey > startup code or executed once
s_VMCancelKeyEx /
s_fDoExitProc /
s_fHVMActive /
s_nErrorLevel /
s_InitFunctions \ MUTEX
s_ExitFunctions /
s_aStatics - MUTEX
classes.c
=========
s_pClasses
s_uiClasses
dynsym.c
========
s_pDynItems \
s_uiDynSymbols > TODO: protect with critical section
s_pAllocSyms /
s_uiClosestDynSym /
estack.c
========
hb_stack
fm.c
====
s_lMemoryBlocks \
s_lMemoryMaxBlocks \
s_lMemoryMaxConsumed > TODO: protect with critical section
s_lMemoryConsumed /
s_pFirstBlock /
s_pLastBlock /
garbage.c
=========
s_pCurrBlock \
s_pLockedBlock \
s_pDeletedBlock > TODO: protect with critical section
s_pSweepExtern /
s_bCollecting /
s_uUsedFlag /
macro.c
=======
s_macroFlags //TODO: hb_stack
memvars.c
=========
s_privateStack //TODO: hb_stack
s_privateStackSize //TODO: hb_stack
s_privateStackCnt //TODO: hb_stack
s_privateStackBase //TODO: hb_stack
s_globalTable \
s_globalTableSize > TODO: protect with critical section
s_globalFirstFree /
s_globalLastFree /
*** COMMON ***
hbver.c
=======
s_fWinNT
s_fInited
hbtrace.c
=========
s_enabled
s_flush
s_fp
s_slevel
s_level
*** RTL ***
cdpapi.c
========
hb_cdp_page - TODO: hb_stack
s_cdpList - const after startup initialization (CDP registration)
errorapi.c
==========
s_errorHandler \
s_errorBlock > TODO: hb_stack
s_iLaunchCount /
s_uiErrorDOS - global? better replaced by current FERROR()
filesys.c
=========
s_fUseWaitLocks - hack, keep it static as is
s_byDirBuffer //TODO: hb_stack
fserror.c
=========
s_uiFError //TODO: hb_stack
s_uiErrorLast //TODO: hb_stack
s_uiOsErrorLast //TODO: hb_stack
gtapi.c
=======
s_bInit
hbgtcore.c
==========
s_hStdIn \
s_hStdOut > const
s_hStdErr /
s_curGT - //TODO: hb_stack
idle.c
======
s_pIdleTasks
s_bIamIdle
s_uiIdleTask
s_uiIdleMaxTask
hb_vm_bCollectGarbage
inkey.c
=======
s_inKeyBlockBefore \
s_inKeyBlockAfter > TODO: TSD
s_fInit /
langapi.c
=========
s_langList - TODO: hb_stack
s_lang - const after startup initialization (LANG registration)
math.c
======
s_hb_exc \
s_hb_matherr_mode \
s_mathHandlerProc > leave it as is - it needs serious cleanup
spMathErrorBlock /
sPrevMathHandler /
set.c
=====
sp_sl_first \
sp_sl_last \ PHB_SET_LISTENER ???
s_next_listener > TODO: hb_stack
sp_set_path /
hb_set /
/*
INITIALIZED AT STARTUP, CONST LATER:
console.c
s_hFilenoStdin, s_hFilenoStdout, s_hFilenoStderr
LEAVE IT AS IS UNPROTECTED
hbrandom.c
s_fInit
- maybe on some platform rand()/srand() should be
covered by critical section
GLOBAL SETTINGs (do not change for MT mode):
alert.prg
s_lNoAlert
THREAD STATICs:
getlist.prg
s_oGetListActive, s_oGetListLast
menuto.prg
s_aLevel, s_nPointer
perfuncs.prg
s_aObjects
readvar.prg
s_cVarName
text.prg
s_cFile, s_lOldPrinter, s_lOldExtra, s_cOldExtraFile
TSD:
xsavescr.c
setkey.c
accept.c
s_szAcceptResult
console.c
s_uiPRow, s_uiPCol
CRITICAL SECTIONs:
gtclip.c
s_szClipboardData, s_ulClipboardLen
*/
*** RDD ***
wacore.c
========
s_WaList \
s_uiWaMax \
s_uiWaSpace > TODO: hb_stack
s_WaNums /
s_uiWaNumMax /
s_uiCurrArea \
s_pCurrArea > TODO: hb_stack
s_fNetError /
workarea.c
==========
s_RddList \ common for all threads synced by user
s_uiRddMax /
************************************************************
hsx.c
=====
s_iHandleCount \
s_iHandleSize > TODO: TSD
s_handleArray /
usrrdd.c
========
s_uiUsrNodes \ common for all threads synced by user
s_pUsrRddNodes /
m6funcs.c
=========
s_ulRecords - TODO: TSD
rmap1.c
=======
s_rlError \
s_rlOptLevel > TODO: TSD
s_RM_bag /
rmap2.c
=======
s_byDelExp \ thread safe
s_ulDelExp / const after initialization during first usage
rmcdx1.c
========
s_uiRddId \ const after RDD registration
rmSuper /
rmntx1.c
========
s_uiRddId \ const after RDD registration
rmSuper /
dbf1.c
======
s_uiRddId \ const after RDD registration
dbfSuper /
delim1.c
========
delimSuper - const after RDD registration
sbf1.c
======
sdfSuper - const after RDD registration
dbfcdx1.c
=========
cdxSuper \ const after RDD registration
s_uiRddId /
dbfdbt1.c
=========
dbtSuper - const after RDD registration
dbffpt1.c
=========
fptSuper \
s_uiRddIdBLOB > const after RDD registration
s_uiRddIdFPT /
dbfntx1.c
=========
ntxSuper \ const after RDD registration
s_uiRddId /
ads1.c
======
adsSuper \
s_iSetListenerHandle \
s_uiRddCount \
s_uiRddIdADS > const after RDD registration
s_uiRddIdADSCDX /
s_uiRddIdADSNTX /
s_uiRddIdADT /
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour