10 Novembre 2022 alle 19:22
#24434
Partecipante
Ho scritto questo ma non sembra funzionare:
using System;
using System.IO;
using System.IO.MemoryMappedFiles;
using System.Threading;
class Program
{
// Process B:
static void Main(string[] args)
{
try
{
using (MemoryMappedFile mmf = MemoryMappedFile.OpenExisting("Theremino1"))
{
var mmf_persistent = MemoryMappedFile.CreateFromFile(@"Theremino1_persist", FileMode.Open);
while (true)
{
mmf_persistent = mmf;
}
}
}
catch (FileNotFoundException)
{
Console.WriteLine("Memory-mapped file does not exist. Run HAL first.");
}
}
}
Qualche suggerimento per metterlo apposto?