'Create a shared memory version of each element of the initial
dictionary. Creates an empty array otherwise, which will extend
automatically when keys are added.
Each different type (all supported types listed in the ``types`` array
above) has its own array. For each key we store an index into the
appropriate array as well as the type of value stored for that key.'

def __init__(self, init_dict=None):

    self.idx = {}
    self.arrays = {}
    if init_dict:
        sizes = {typ: 0 for typ in self.types.keys()}
        for v in init_dict.values():
            if (type(v) not in sizes):
                raise TypeError((('SharedTable    does    not    support    values    of    ' + 'type    ') + str(type(v))))
            sizes[type(v)] += 1
        for (typ, sz) in sizes.items():
            self.arrays[typ] = RawArray(self.types[typ], sz)
        idxs = {typ: 0 for typ in self.types.keys()}
        for (k, v) in init_dict.items():
            val_type = type(v)
            self.idx[k] = (idxs[val_type], val_type)
            if (val_type == str):
                v = sys.intern(v)
            self.arrays[val_type][idxs[val_type]] = v
            idxs[val_type] += 1
    for (typ, ctyp) in self.types.items():
        if (typ not in self.arrays):
            self.arrays[typ] = RawArray(ctyp, 0)
    self.lock = Lock()
