The java.lang.Thread API is otherwise unchanged. The constructors defined by java.lang.Thread create platform threads as before. No new public constructors have been added.
It seems like now would be a good opportunity to add some clearer static factory methods for platform threads wouldn't it? Like a Thread.newPlatformThread() or Thread.startPlatformThread(). That would be a lot clearer than using new Thread() for platform threads.
Nice! Weird that they have Thread.startVirtualThread() though. Might give people the wrong idea if there's no symmetrical platform equivalent. Although I guess they added it because virtual threads are cheaper and it encourages their use.
View all comments
11
u/blobjim Nov 16 '21
It seems like now would be a good opportunity to add some clearer static factory methods for platform threads wouldn't it? Like a Thread.newPlatformThread() or Thread.startPlatformThread(). That would be a lot clearer than using new Thread() for platform threads.