multithreading - Impact of thread without name in java -


There are several threads with syntax in my Java application

  new thread (this) . Start();   

When I use code audit, I receive a message

  Thread declares without a name   

I want to know what it means and it is fine if I change the declaration

  to the new thread (this, this.getName ()). .Start();   

What is the difference between those and their effectiveness in advance thanks?

It's just a humble way to code Pro, reminding you that identifying a thread for easy debugging It should be a name if it comes to doing. There is no other "effect" besides this, it is just a good programming practice. It should work:

  New thread (This is called " A recognizable name "). Start ();   

Note that this.getName () will only work if you already get a name from getName () Current class can send.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -