divide application to two threads