You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I sometimes get exceptions like this below when I create several instances of FsiEvaluationSession at almost the same time. I do not run evaluations on them yet. This does not happen always and the affected assembly is not always the same.
Is this a concurrency issue? I would like to know if it is OK to create (and run) several FSI Session concurrently?
error FS3160: Problem reading assembly 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Runtime.dll': Object reference not set to an instance of an object.
Error creating evaluation session: StopProcessingExn None
at Microsoft.FSharp.Compiler.Interactive.Shell.-ctor@2576-143.Invoke(String message) in C:\projects\fsharp-compiler-service\src\fsharp\fsi\fsi.fs:line 2576
at Microsoft.FSharp.Compiler.Interactive.Shell.FsiEvaluationSession..ctor(FsiEvaluationSessionHostConfig fsi, String[] argv, TextReader inReader, TextWriter , TextWriter errorWriter, Boolean fsiCollectible, Boolean msbuildEnabled) in C:\projects\fsharp-compiler-service\src\fsharp\fsi\fsi.fs:line 2422
at Microsoft.FSharp.Compiler.Interactive.Shell.FsiEvaluationSession.Create(FsiEvaluationSessionHostConfig fsiConfig, String[] argv, TextReader inReader, TextWriter , TextWriter errorWriter, FSharpOption`1 collectible, FSharpOption`1 msbuildEnabled) in C:\projects\fsharp-compiler-service\src\fsharp\fsi\fsi.fs:line 2877_
The text was updated successfully, but these errors were encountered:
Thanks for your help @dsyme ! I want to parse and check (and maybe evaluate) several unrelated fsx files. I am using interactive sessions for that. Is the only way to do this savely to do it one after the other? Can one session parse and check code while evaluating some other code?
Thanks for your help Don! I want to parse and check (and maybe evaluate) several unrelated fsx files. I am using interactive sessions for that. Is the only way to do this safely to do it one after the other? Can one session parse and check code while evaluating some other code?
For parsing and checking, you could use the Compiler Services API (FSharpChecker). This doesn't do anything in parallel but it at least ensures that concurrent requests are serialized one by one in a thread safe way, allowing multi-threaded use of FSharpChecker objects.
In the future
FSiEvaluationSession is likely to be changes to use FSharpChecker for all parsing and checking, which will make it serial as well.
We may make FSharpChecker do parsing in parallel, and checking in serial. There's an open request for this.
But in short it's not really possible to do this stuff safely in parallel today
I sometimes get exceptions like this below when I create several instances of FsiEvaluationSession at almost the same time. I do not run evaluations on them yet. This does not happen always and the affected assembly is not always the same.
Is this a concurrency issue? I would like to know if it is OK to create (and run) several FSI Session concurrently?
The text was updated successfully, but these errors were encountered: