network working without threads