You cannot have two instance of the PHT running at the same time.What you _can_ do is have single instance running. PHT is thread safe
On Sun, May 17, 2009 at 10:49 PM, nabils <[email protected]> wrote: > > Switched to the below and still got the same error? Do I need to > handle the locking myself? > > public class Program > { > private const string testDatabase = "test.esent"; > > private static void Main(string[] args) > { > for (int j = 0; j < 2; j++) > { > var thread = new Thread(x => > { > for (int i = 0; i < 50000; i++) > { > var guid = Guid.NewGuid().ToString(); > > using (var table = new PersistentHashTable > (testDatabase)) > { > table.Initialize(); > table.Batch(actions => > { > actions.Put(new PutRequest > { > Key = guid, > IsReadOnly = true, > ParentVersions = new ValueVersion > [0], > Bytes = Encoding.ASCII.GetBytes > ("This is a test string") > }); > actions.Commit(); > }); > } > Console.WriteLine(guid); > Thread.Sleep(1000); > } > }); > thread.Start(); > } > } > } > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Rhino Tools Dev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rhino-tools-dev?hl=en -~----------~----~----~----~------~----~------~--~---
