-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CAS] Don't create the same CAS multiple times from the same Oracle #1511
[CAS] Don't create the same CAS multiple times from the same Oracle #1511
Conversation
@swift-ci please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me.
...s/SwiftDriver/ExplicitModuleBuilds/InterModuleDependencies/InterModuleDependencyOracle.swift
Outdated
Show resolved
Hide resolved
fbc27b6
to
f7e93e5
Compare
@swift-ci please test |
createdCASMap[path] = CASConfig(onDiskPath: onDiskPath, pluginPath: pluginPath, pluginOptions: pluginOptions, cas: cas) | ||
return cas | ||
} | ||
// If onDiskPath is nil, just create a new CAS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the client will end up depending on getOrCreateCAS
to avoid creating separate CAS instances for every Swift invocation, could you also share CAS instances even if onDiskPath
is nil (in case passing nil onDiskPath
becomes important in the future), using pluginPath
+pluginOptions
as key in a separate dictionary?
If the oracle has been used to create a CAS for the path, reuse the CAS if it is asked to create the same CAS again. This not only save the work of creating the CAS, but also avoid a potential problem that the CAS closing synchronization doesn't work across threads in the same process due to its uses of file lock.
f7e93e5
to
60f3a10
Compare
@swift-ci please test |
1 similar comment
@swift-ci please test |
If the oracle has been used to create a CAS for the path, reuse the CAS if it is asked to create the same CAS again. This not only save the work of creating the CAS, but also avoid a potential problem that the CAS closing synchronization doesn't work across threads in the same process due to its uses of file lock.