Post
Topic
Board Altcoin Discussion
Re: ion discussion
by
ion.cash
on 02/10/2015, 02:09:34 UTC
I disappeared for longer than expected due to health issues which were preventing me from having any mental energy for working. I have detailed this over the past days under my other username TPTB_need_war.

I am on the 4th consecutive day of continuous reasonably pain-free health and somewhat reasonable energy level (still not ideal, but not always zombified). I was able to run 2.25 kms at 8:30 mile pace in the hot tropical sun each of the past 3 days (will attempt again after writing this), got one barbell and basketball shoot around workout in those 3 days also, and 2 of those days I exceed 4 kms with a second run later in the day. I also finally got my driver's license renewal (which is critical for being able to get daily errands done efficiently) which had represented a big hurdle due to the unwillingness of the LTO (land transportation office) to issue a driver's license with night time driving privilege to someone blind in one eye (as I am). I had to get a medical certificate from an ophthalmologist which was a struggle to accomplish due to the low energy I was experiencing, as well very difficult to find one who wasn't on vacation.  Then my uncorrected eye sight had declined from 20/40 to 20/70 just since early August (perhaps due to the 10 day fasting I attempted as a cure in late August, but I don't know). My vision should improve as my overall health does, since it is hypothesized (but not clinically verified yet) that the gut dysbiosys is driving the autoimmunity which is attacking my visual cortex.

In any case, a big change in diet to focus on live probiotics, wild grown green leaves, raw tuna, and restarted my vitamin D3 supplementation but at a more subdued level of 20,000 IU daily, so far has me in an improving state-of-health over the past 4 days.

As of today, I have completed both the single-threaded and multi-theaded coding for the linear probe hash table which is a central component of the algorithm I am developing. Here is the heading comment for the multi-threaded version of it. I still intend to post some open source code soon to demonstrate progress. My health has been really debilitating and I have done Herculean effort to try to cure it. I don't think words could describe the minute-by-minute struggle I have been fighting.

Code:
package collections.hashed

/*
TODO: in Scala 3 we can require KEY, VAL, and CNT to be Int or Long, since we
      can express a first-class disjunction type.
*/
trait LinearProbe[@specialized(Int,Long) KEY, @specialized(Int,Long) VAL, @specialized(Int,Long) CNT] {
  def count: CNT
  // Whether entry was inserted. Value ‘0’ will return ‘false’ (internally ‘0’ values denote an empty entry).
  def insert(key: KEY, value: VAL): Boolean
  // Whether entry was removed.
  def remove(key: KEY): Boolean
  // Value that matches the given key, else ‘0’.
  def value(key: KEY): VAL
}

/*
Thread-safe LinearProbeLongInt optimized for ‘insert’, ‘find’, and ‘value’ (but not ‘remove’).
Do not employ more threads than hardware threads.

Writers are sequentially synchronized, and readers run asynchronously. Writers
wait for all active readers to complete, and readers wait for all queued writers
to complete. Non-blocking coordination is employed because a context-switch
costs a thousandth to a hundredth of a millisecond, i.e. 100,000 - 1 million
operations per second. Whereas, the critical sections of the ‘insert’, ‘find’,
and ‘value’ have a throughput in excess of 10 million operations per second.

The lines of code added to make this class thread-safe are tagged with /**/
*/
class ThreadedInsertLinearProbeLongInt(bits: Byte, lsr: Byte) extends LinearProbe[Long, Int, Int] {

I do not expect to post often. I'll post when there are significant developments.