Skip to content

Commit

Permalink
ASYNC: If TS is disabled then free DF are now moved to a global DF
Browse files Browse the repository at this point in the history
The underlying issue is that for some caching key determination we use
WaveModCount that does not support free waves when executed from the
main thread.
This issue comes up e.g. when the LNB is accessed due to the key wave caching.

The solution is to move the prepaed DF to a global location before calling
ASYNC_Worker. The global DF is created as a trash* DF in the MIES DF.
Since certain actions, like TP acquisition would create a massive amount of
these temporary DFs, the trash DFs are cleaned up whenever
a new ASYCNC workload is pushed. This is good enough for debugging
purposes.
  • Loading branch information
MichaelHuth committed Aug 15, 2024
1 parent ce02f8f commit 2128a73
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Packages/MIES/MIES_Async.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ Function ASYNC_Execute(dfr)
DFREF dfr

variable orderIndex, size, index
string dest

ASSERT(ASYNC_IsThreadDF(dfr), "Invalid data folder or not a thread data folder")
NVAR tgID = $GetThreadGroupID()
Expand Down Expand Up @@ -617,6 +618,15 @@ Function ASYNC_Execute(dfr)
endif

#ifdef THREADING_DISABLED
if(IsFreeDataFolder(dfr))
KillTrashFolders()
DFREF tmpdfr = GetUniqueTempPath()
dest = RemoveEnding(GetDataFolder(1, tmpDFR), ":")
MoveDataFolder/Z dfr, $dest
if(V_flag)
printf "ASYNC_Execute: Could not move free DF to global DF: %s to %s\r", GetDataFolder(1, dfr), dest
endif
endif
DFREF result = ASYNC_Run_Worker(dfr)
WAVE/DF serialExecutionBuffer = GetSerialExecutionBuffer(getAsyncHomeDF())
index = GetNumberFromWaveNote(serialExecutionBuffer, NOTE_INDEX)
Expand Down

0 comments on commit 2128a73

Please sign in to comment.