Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8184334

Generalizing Atomic with templates

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P3
    • Resolution: Other
    • Affects Version/s: 10
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
      None

      Description

      The Atomic class mostly uses the JNI-specific j-types (jbyte, jshort, jint, jlong). This has led to wide-spread pollution of j-types in the C++ code base.

      Another problem is that when dealing with certain inherently not j-typed types like pointers, hacks were built that allowed them using _ptr member functions that had to be specialized on every architecture supported by Java.

      Yet another problem is yet another exception, like size_t, that does not quite fit being a pointer and isn't necessarily mapped to any j-type. Then yet more exceptions were built on top.

      As a remedy to the above mentioned problems, I propose to generalize the Atomic implementation to use templates instead.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              eosterlund Erik Ă–sterlund
              Reporter:
              eosterlund Erik Ă–sterlund
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: