Five parallel thread are running after successfully execution of three i want to kill/disable rest two thread

In reply to dave_59:

But in actual software, don’t we run threads interleaved and not parallel? So only one process should increment the count variable at a time. We should be able to see count == 3.