Method: Iodine.threads=

Defined in:
ext/iodine/iodine.c

.threads=(val) ⇒ Object

Sets the number of worker threads that will be used when start is called.

Negative numbers are translated as fractions of the number of CPU cores. i.e., -2 == half the number of detected CPU cores.

Zero values promise nothing (iodine will decide what to do with them).

Parameters:

  • thread_count (FixNum)

    The number of worker threads to use



142
143
144
145
146
147
148
149
# File 'ext/iodine/iodine.c', line 142

static VALUE iodine_threads_set(VALUE self, VALUE val) {
  Check_Type(val, T_FIXNUM);
  if (NUM2SSIZET(val) >= (1 << 12)) {
    rb_raise(rb_eRangeError, "requsted thread count is out of range.");
  }
  rb_ivar_set(self, rb_intern2("@threads", 8), val);
  return val;
}