![]() In a somewhat convoluted but effective way, this is supposed to solve the problem of accidental substitution of a reference value coming from ThreadLocal. set method – so it is (unfortunately, only in a ‘shallow’ way) non-mutable additionally, it should be declared as final, and its value is only set in the where method. Firstly, it allows a very specific range of ‘validity’ of the variable to be specified – something that could not be achieved with a regular ThreadLocal, which is a kind of data bag. ![]() The above structure has several advantages. final static ExtentLocal V = new ExtentLocal() Their purpose is to allow the sharing of non-mutated data within and between threads. What are extent-local variables? They are an alternative to the existing ThreadLocal, created as a companion to Project Loom. Let us, therefore, take a look at what lies behind it. Hence, I am undoubtedly delighted to inform you that the candidate JEP 429: Extent-Local Variables (Incubator) appears in the 100th edition of our Weekly. However, August is slowly coming to an end, JDK 19 has already received its first Release Candidate, so you can think about the future. There are (I suspect) two reasons for this: the holiday season and the preparation period for the release of the new JDK. We have not had the opportunity to update you on any new JEPs for some time.
0 Comments
Leave a Reply. |