Example #1
0
        static async Task TestMultithreading()
        {
            Random rand = new Random();

            using (DictionaryQuery <string> dic = cx.DictionaryQuery <string>("async"))
            {
                for (int i = 0; i < 15; i++)
                {
                    if (!dic.ContainsKey("nb" + i))
                    {
                        await Task.Delay(rand.Next(1000));

                        dic["nb" + i % 2] = "whatever" + i;
                    }
                }

                dic.Clear();
            }
        }