java thread setname_java – 为什么Thread类中的setName分配给一个字符数组?为什么不是一个字符串?...

There was an RFE for this way back in late 2002:

4745629 (thread) Thread.setName does needless string allocations

(don’t use char[])

The initial eval in 2002 stated:

“I can’t imagine that this serIoUsly impacts the performance of any

real program. Furthermore,changing the fields in Thread is

problematic due to the close relationship of this class with the VM.

That said,it might be worth addressing this in the context of some

Thread code-cleanup.”

Then in 2005 it was closed as “will not fix”:

“There are dependencies on the name representation being a char array in the JVM and this RFE must be respectfully rejected.”

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值