Class ThreadTest

java.lang.Object
org.nfunk.jepexamples.ThreadTest

public class ThreadTest extends Object
This class tests the thread safety of the JEP package with a brute force approach. 1000 threads are started, and each one invokes the evaluate method. The evaluate method creates 10 JEP instances. Note that running this class successfully does not necessarily ensure that no errors will ever occur.

Thanks to Matthew Baird and Daniel Teng for this code.

  • Constructor Details

    • ThreadTest

      public ThreadTest()
  • Method Details

    • main

      public static void main(String[] args)
      Main method. Launches many threads.
    • evaluate

      public void evaluate()
      Perform a simple evaluation using a new JEP instance. This method is called by all ThreadTestThreads at very much the same time.