Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

how to share ctable object in share memory with multi process #412

@WoolenWang

Description

@WoolenWang
the_ctable = bcolz.open('test_ctable.bcolz', 'r')
table_ndarray = the_ctable[:]
from multiprocessing.sharedctypes import RawArray
the_memory = RawArray('b', table_ndarray.nbytes)
dst_data = np.ndarray(buffer=the_memory, dtype=table_ndarray.dtype, shape=table_ndarray.shape)
np.copyto(dst_data, table_ndarray)
from multiprocessing import Process
proc = Process(target=other_process,args=(the_memory,))
proc.start()

using this way can share the ctable data with ndarray type, but the data is not compressed and consume too many memory, is that any way to share ctable object in share memory ??

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions