Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-3809

SimpleIncrementingIdGenerator not thread-safe

    XMLWordPrintable

    Details

      Description

      Looking at the sourcecode of SimpleIncrementingIdGenerator, I get the impression that it's not thread-safe, but should it be so?

      Given the following thread scheduling:

      Thread 1 bottom incremented (rolled) to 0     increment old top return {incremented top,0}
      Thread 2   bottom incremented to 1 return {old top,1}    

      Wouldn't the value in red be non-unique? Am I missing something?

        Attachments

          Activity

            People

            Assignee:
            abilan Artem Bilan
            Reporter:
            andrei.amariei Andrei Amariei
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: