sub thread { my $tid = threads->tid; my( $Q ) = @_;