Giter Club home page Giter Club logo

primethread's Introduction

PURPOSE: Pasrsing input file and get the maximum value of checked prime number and other debug values which set using thread and debug value.

FILES: Driver.java, Results.java, ResultInterface.java, StdoutInterface.java, StoreDataInterface.java, CreateWorker.java, WorkerThread.java, FileProcessor.java, IsPrime.java, Logger.java.

SAMPLE OUTPUT: Depends upon Input, However:   ”The sum of all the prime numbers is:251699515".

COMPILE THE CODE: ant -buildfile src/build.xml all

RUN THE CODE: ant -buildfile src/build.xml run -Darg0=input.txt -Darg1=5 <-No of thread> -Darg2=0 <Debug Value>

No of thread should be in between 1 to 5 (inclusive)

The DEBUG_VALUE, read from the command line, should be set in the Logger class. 
Use the DEBUG_VALUE in the following way:
DEBUG_VALUE=4 [Print to stdout everytime a constructor is called] 
DEBUG_VALUE=3 [Print to stdout everytime a thread's run() method is called] 
DEBUG_VALUE=2 [Print to stdout everytime an entry is added to the Results data structure]
DEBUG_VALUE=1 [Print to stdout the contents of the data structure in the store] 
DEBUG_VALUE=0 [No output should be printed from the application, except the line "The sume of all the prime numbers is: XYZ" ]

CHOICE OF DATA STRUCTURE: Vector
->Complexity of Data Structure:
		
Space	O(n)
Search	O(n)
Insert	O(1) [Amortized]
Delete	O(n)
->Vector is synchronized and it is thread safe.
->Lock supports with locking an entir vector. 
->Size increment by doubled. So for larger number reduce an overhead for copying the data from past array into the new array.

primethread's People

Contributors

vishvas avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.