Profile Picture

Parallelization issue with the PersistenceManager

Posted By Niranjan Singh 4 Years Ago
Author
Message
Niranjan Singh
Posted 4 Years Ago
View Quick Profile
Forum Member

Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)

Group: Forum Members
Last Active: 4 Years Ago
Posts: 49, Visits: 179
Hi Team,

We are trying to create drawing documents using the saved diagram XML string in parallel threads and we found that "persistencyManager.LoadFromStream" is blocking the thread.
It is locking the threads and making them wait to complete.


using (MemoryStream drawingStream = new MemoryStream(System.Text.Encoding.ASCII.GetBytes(drawingString)))
        {
          // now load the persistent document from the memory stream
          NPersistencyManager persistencyManager = new NPersistencyManager();
          drawingStream.Position = 0;
          persistencyManager.LoadFromStream(drawingStream, Nevron.Serialization.PersistencyFormat.XML, null);
         NDrawingDocument nDrawing = (NDrawingDocument)persistencyManager.Persistentdocument.Sections[0].Object;
         }




Any idea that how can we parallelize this in an efficient way so that we can load multiple diagrams from the list of xml strings.

Nevron Support
Posted 4 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,000
Hi,

We recommend you try loading each document in a different thread. To do that, create a new instance of NPersistencyManager in each thread and load the document with it.


Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic