I didn't see this before, first time encountered while making compactor.
The issue is following: when only READING from many threads one shared locator, mistake appears. Mistake appears sometimes, in this example you will definitely catch it.
Code for reproduction:
public void Main() { InitTable(); StartManyThreads(); }XTable<string, string> myxtable = null; string myxtable_stringName = "myTableName"; StorageEngine se = null; private void InitTable() { File.Delete(e1dbPath); se = StorageEngine.FromFile(e1dbPath); myxtable = se.Scheme.CreateOrOpenXTable<string, string>(new Locator(myxtable_stringName)); se.Scheme.Commit(); myxtable["t1"] = "sdfjsdlfkjsdlfj sl"; myxtable["t2"] = "sdfjsdlfkjsddsdfsdfj sl"; myxtable["t3"] = "sdfjsdlsadfasdfsadfasdsafkjsddsdfsdfj sl"; myxtable.Commit(); }private void ReadIt1(object key) { bool couldGetValue = false; string stringValue = String.Empty; for (int i = 0; i < 10000; i++) { try { couldGetValue = myxtable.TryGet(Convert.ToString(key), out stringValue); } catch (Exception ex) { //--------------------------- PUT A BREAKPOINT //Exception: LinkedList node doesn't belong to the curernt LinkedList //Occurs in FTable.Link.Touch() throw ex; } } Console.WriteLine("DONE"); }private void StartManyThreads() { for (int i = 1; i <= 3; i++) { System.Threading.Thread tr = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(ReadIt1)); tr.Start("t" + i.ToString()); } }


LinkBack URL
About LinkBacks
Reply With Quote
