zhztheplayer commented on code in PR #7479:
URL: https://github.com/apache/incubator-gluten/pull/7479#discussion_r1797555521
##########
cpp/core/compute/Runtime.cc:
##########
@@ -68,4 +68,11 @@ void Runtime::release(Runtime* runtime) {
delete runtime;
}
+std::optional<std::string>* Runtime::localWriteFilesTempPath() {
+ // This is thread-local to conform to Java side ColumnarWriteFilesExec's
design.
+ // FIXME: Pass the path through relevant member functions.
+ static thread_local std::optional<std::string> path;
Review Comment:
> The patch adding a new atomic localWriteFilesTempPath but seems not
related with memory pool?
Using isolated runtimes will break the previous assumption that Velox plan
always see this `localWriteFilesTempPath` which is set globally in code.
> do we really need thread_local here?
Different tasks may have different `localWriteFilesTempPath`s set. So
thread_local is needed.
This solution should finally be refactored out in future. We cannot rely too
much either on `thread_local`s or on global states. Although the previous code
didn't direcly use thread local storages, it relied on Spark's internal threal
local states implicitly.
I see we have been using multiple thread locals or global states in this
part of code or relevant code. We should keep an eye on them and do refactors
once we got time. It's important for our code health.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]