some experiment with select to avoid deadlock and added tail ptr in used_list