use Tree::BK_XS; use threads; use threads::shared; my $o : shared = new Tree::BK_XS; # filling tree $o->insert('foo', 1); # now new thread sees filled tree threads->create(sub{ print $o->search('foo') });