/// <summary>
        /// Initializes a new instance of the <see cref="T:OpenLisp.Core.DataTypes.Concurrent.OpenLispSkipList"/> class.
        /// </summary>
        public OpenLispSkipList()
            : base()
        {
            // TODO: finalize skip list start and end tokens
            //Start = "o(";
            //End = ")o";

            Value = new ConcurrentSkipList <OpenLispVal>();
        }
Example #2
0
        /// <summary>
        /// Join the specified values, delim and printReadably.
        /// </summary>
        /// <returns>The join.</returns>
        /// <param name="values">Values.</param>
        /// <param name="delim">Delim.</param>
        /// <param name="printReadably">If set to <c>true</c> print readably.</param>
        public static string Join(ConcurrentSkipList <OpenLispVal> values, string delim, bool printReadably)
        {
            var vals = values.ToList().ToArray();

            //values.CopyTo(vals, 0);

            //Console.WriteLine("Attempting to pretty print vals={}", vals));

            return(Join(vals, delim, printReadably));
        }
        public void ConcurrentReadWritePerformance()
        {
            const int count = 10;
            var       times = new int[count];
            var       c     = new ConcurrentSkipList <int>();

            for (var i = 0; i < count; i++)
            {
                var t = new CollectionReadWritePerformance(c, 10, 5, 10000);
                times[i] = t.Run().Milliseconds;
//                PrintSkipListForm(c);
                c.Clear();
            }

            Console.WriteLine("Avg: {0}, Min: {1}, Max: {2}", times.Average(), times.Min(), times.Max());
            Console.WriteLine(string.Join(" ", times));
        }
Example #4
0
 public void Setup()
 {
     skiplist = new ConcurrentSkipList <int>();
 }
        protected override void OnSetUp() {
            base.OnSetUp();

            _skipList = new ConcurrentSkipList<int>();
        }
		public void Setup()
		{
			skiplist = new ConcurrentSkipList<int>();
		}
Example #7
0
 public AddList(IComparer <TKey> keyComparer)
 {
     this.keyComparer          = keyComparer;
     this.addedItemsDictionary = new ConcurrentSkipList <TKey, byte>(this.keyComparer);
 }