Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Mutithreading Framework?

  1. #1
    Junior Member
    Join Date
    May 2014
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Mutithreading Framework?

    Is there a frame Work or library present for Multithreading scenario that can help the developer to ease the thread development by allowing the developer to just submit a task and execute it by Thread-per-request architecture? ie the developer does not need to extend Thread class or implement Runnable interface but he should submit the task to the framework and frame work handle the thread creation and destruction itself so that the developer can just concentrate on task coding


  2. #2
    Junior Member
    Join Date
    May 2014
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Multithreading frame works?

    Is there a frame Work or library present for Multithreading scenario that can help the developer to ease the thread development by allowing the developer to just submit a task and execute it by Thread-per-request architecture? ie the developer does not need to extend Thread class or implement Runnable interface but he should submit the task to the framework and frame work handle the thread creation and destruction itself so that the developer can just concentrate on task coding

  3. #3
    Member
    Join Date
    Jul 2013
    Location
    Europe
    Posts
    400
    Thanks
    0
    Thanked 68 Times in 57 Posts

    Default Re: Multithreading frame works?

    Actually creating a thread and overwriting the run method is pretty simple, I dont think it can get any simpler then that no matter what kind of framework you use.

    If you want, for example, a Thread that is periodically writing the time to the standard output you could write code like this:
    		Thread t = new Thread() {
    			public void run() {
    				while (true) {
    					System.out.println(new Date());
    					try {
    						sleep(100);
    					} catch (InterruptedException e) {}
    				}
    			}
    		};
    		t.start();
    There is no black magic involved, its all pretty straight forward.
    You dont even have to care about any destruction or clean up, the garbage collector will do that for you once the thread has stopped execution. (in this case that wont happen since it runs forever)

  4. #4
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    4,495
    My Mood
    Mellow
    Thanks
    152
    Thanked 610 Times in 597 Posts

    Default Re: Mutithreading Framework?

    Thread moved.

    Honest question: In your mind, is there a difference between a developer and a programmer? Does the programmer get his/her hands dirty adjusting the nuts and bolts in the depths of the language at its interface with the hardware while the developer uses tools (frameworks?) built by programmers, enabling them to stay at arm's length from the details, unconcerned about what's happening under the hood?

    The multi-threading concept you describe would not be that hard to program and would be an interesting, confidence-building exercise for someone who may not be too sure of their threading skills. You can find some very good multi-threading tutorials and discussions by searching "java concurrency".

    --- Update ---

    Please do not post multiple threads on the same topic.

    Threads merged.

Similar Threads

  1. Java MutiThreading Stock
    By tanchiwoo in forum What's Wrong With My Code?
    Replies: 5
    Last Post: February 17th, 2014, 04:37 AM
  2. Spring Framework
    By Napsy in forum Web Frameworks
    Replies: 3
    Last Post: January 23rd, 2013, 06:04 AM
  3. Mutithreading problem
    By ashish12169 in forum Threads
    Replies: 1
    Last Post: January 8th, 2013, 06:30 AM
  4. Self Adaptive framework
    By dpunitha in forum What's Wrong With My Code?
    Replies: 0
    Last Post: January 4th, 2013, 11:49 PM
  5. Replies: 1
    Last Post: October 20th, 2009, 06:31 AM

Tags for this Thread