I think that your design is not good. If 10000 users send message to you at the same time, then you must create 10000 threads. Do you think that your server has the ability? So It will be dead. It is not better that the thread number is more than one number, such as 50.