0 Replies Latest reply on Jul 14, 2009 7:50 PM by Sean Montgomery

    ThreadPoolDispatcher thread-safety in Seam 2.1.x?

    Sean Montgomery Newbie

      Looking at the RunnableAsynchronous class nested in ThreadPoolDispatcher, it seems like the future field should be volatile. If not, couldn't the value assigned via RunnableAsynchronous.setFuture in ThreadPoolDispatcher.scheduleWithExecutorService fail to be seen when RunnableAsynchronous.run is called on the ScheduledExecutorService thread?  Or is some Seam magic guaranteeing the memory visibility of future?

      Also, isn't there a chance that the executor thread could have run the RunnableAsynchronous.run method to completion before the setFuture call was made on the submitting thread?