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

Generalizing Atomic with templates

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Other
    • Icon: P3 P3
    • 10
    • 10
    • hotspot
    • None

      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.

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

              Created:
              Updated:
              Resolved: