How to make different threads do different jobs.

While reading Threads everywhere I find examples of 1 or more threads all doing the same job.
How can I create code so that different threads can be allotted different jobs. For ex, I want to thread one check whether a number is odd or even and thread two should check whether a number is prime or not.

Second, could u plz clear one more thing.http://www.catb.org/~esr/faqs/smart-questions.html#writewell
How To Ask Questions The Smart Way
Eric Steven Raymond
Rick Moen
Write in clear, grammatical, correctly-spelled language
We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding (often enough to bet on, anyway). Answering questions for careless and sloppy thinkers is not rewarding; we'd rather spend our time elsewhere.
So expressing your question clearly and well is important. If you can't be bothered to do that, we can't be bothered to pay attention. Spend the extra effort to polish your language. It doesn't have to be stiff or formal - in fact, hacker culture values informal, slangy and humorous language used with precision. But it has to be precise; there has to be some indication that you're thinking and paying attention.
Spell, punctuate, and capitalize correctly. Don't confuse "its" with "it's", "loose" with "lose", or "discrete" with "discreet". Don't TYPE IN ALL CAPS; this is read as shouting and considered rude. (All-smalls is only slightly less annoying, as it's difficult to read. Alan Cox can get away with it, but you can't.)
More generally, if you write like a semi-literate b o o b you will very likely be ignored. So don't use instant-messaging shortcuts. Spelling "you" as "u" makes you look like a semi-literate b o o b to save two entire keystrokes.

Similar Messages

  • How to make different users to use different Plan_Tables?

    How to make different users to use different Plan_Tables?
    I want each user use his own's Plan_Table. How to achieve this goal?

    qkc wrote:
    How to make different users to use different Plan_Tables?
    I want each user use his own's Plan_Table. How to achieve this goal?Which version of Oracle - if you're on 10g or later you are already (effectively) doing this.
    If not, then copy the 10g strategy back to your version; in outline:
    <ul>
    drop all existing plan tables
    create a table (but call it plan_table$) in the SYS schema (you may prefer to use SYSTEM) as a global temporary table on commit preserve rows
    create a public synonym plan_table for plan_table$
    grant select insert update delete on plan_table to public
    </ul>
    Look in $ORACLE_HOME/rdbms/admin/catplan.sql in a 10g version of Oracle to check how it's done.
    Each user gets a private (temporary) table in their temporary tablespace whenever they use the plan_table
    Their private data disappears when there session ends.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.
    There is a +"Preview"+ tab at the top of the text entry panel. Use this to check what your message will look like before you post the message. If it looks a complete mess you're unlikely to get a response. (Click on the +"Plain text"+ tab if you want to edit the text to tidy it up.)
    "Science is more than a body of knowledge; it is a way of thinking"
    Carl Sagan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to make a Thread loop?

    Hi, I was wondering how to make a thread start over again from the beginning once it finishes, if it hasn't been stopped already.

    package src.Utility;
    public class ThreaTest extends Thread{
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              ThreaTest threaTest= new ThreaTest();
              while(true){
                   try{
                   if (!threaTest.isAlive()){
                        threaTest= new ThreaTest();
                        threaTest.start();
                   }//else{
                        //System.out.println("");
                   }catch (Exception e) {
                        e.printStackTrace();
         public void run(){
              System.out.println("-----11---------");
    }try the above code and then tell me if this loop works for you???

  • How to make a Thread alive througout the process like Listener threads

    Dear Friends ,
    How to make a Thread stay alive throughout the process i.e even after the completion of the execution .
    My requirement is to create a Listener...in Java Listener threads will stay alive throughout the process(Ex: MouseListener..whenever we move mouse on a particular button some code will be executed, so some thread is running) . What kind o Thread is this . Is it possible to create a Tread like this in our programs .
    Thanks ,
    Rajesh Reddy

    My requirement is to create a Listener...in Java Listener threads will stay alive throughout the process(Ex: MouseListener..whenever we move mouse on a particular button some code will be executed, so some thread is running) . What kind o Thread is this . MouseListener is not a thread. Any thread can invoke the methods of MouseListener, although typically the UI thread will invoke it when an event happens.
    Is it possible to create a Tread like this in our programs .It is not a thread, but I almost definitely, depending on what you are trying to do
    >
    Thanks ,
    Rajesh Reddy

  • How to make different events with different colors on calendar, on my new iPad

    how to make events on calendar with different colors ?

    Sergio,
    The color of an event is dictated by the color assinged to the calendar it's on.
    Tap Calendars then tap Edit to either changed the color of an existing calendar or to add a new one.
    Matt

  • How to make different folders in photo album

    I have been addings photos in album. Now I want to make different folders in the album but unable to do so. Please guide.

    I may be misunderstanding what you want to do,
    You can create albums on the iPad in order to organize photos but I believe that you must be running iOS 5 at least. Your tagline shows iOS 4.3.2. It's been quite a while since I was running iOS 5, but I'm pretty sure it was introduced in iOS 5.
    If you are running iOS 5 or higher, launch the photos app and tap on Photos, then tap on the Edit button in the upper right. Select all of the photos that you want to place into an album by tapping on them. Then tap on Add To and choose Add to New Album. Name the new Album in the popup window and then tap Save.
    If you are not running iOS 5 - you have to import the photos from the camer roll to your computer, creat the albums on the PC and then sync them back to the iPad via iTunes.
    read about importing photos here.
    http://support.apple.com/kb/HT4083

  • How to make different text orientation in XML publisher

    Hello, everyone,
    Please Can you help me to resolve this problem:
    Have xml data:
    <rating>good</rating>
    <rating>normal</rating>
    <rating>low</rating>
    <rating>very low</rating>
    the result should look like this:
    col1 col2 col3 col4
    row1 g n l v
    row2 o o o e
    row3 o r w r
    row4 d m y
    row5 a
    row6 l l
    row7 o
    row8 w
    Any adies?
    Thank's

    sorry, then I posted my message, the table was too bad...so now it seems to be better. Any Ideas, how to make like this?
    ---------col1--col2--col3 col4
    row1.....g......n......l.......v
    row2.....o......o.....o.......e
    row3.....o......r......w.......r
    row4.....d......m.............y
    row5.............a
    row6.............l...............l
    row7............................o
    row8............................w
    Any adies?
    Thank's

  • How to make different ringtone

    how to make ringtone and set as ringbell.

    Google will find several ways to create ringtones for iphone.
    You can then sync them to the iphone.

  • How to make several threads do smth at the same time?

    Hello!
    Is there a way to make several threads guaranteedly do something at exactly the same time? The code below creates two identical Random objects with approximately 90% probability, in 10% cases Random's are different (Random constructor takes current system time as its argument). But how to ensure it 100%?
    import java.util.*;
    public class SyncThreads extends Thread {
         static Date DATE;
         static long CURRENT_TIME;
        public static void main(String args[]) {
              DATE = new Date();
              CURRENT_TIME = DATE.getTime();
                    new SyncThreads().start();
              new SyncThreads().start();
         public void run()
              try
                   Date thread_date = new Date();
                   long diff = thread_date.getTime() - CURRENT_TIME;
                            //sleeping untill it's 1 second since the 1st line of main() executed
                   sleep(1000 - diff);
                   int r_i = new Random().nextInt();
                   System.out.println(r_i);          }
              catch (InterruptedException e)
                   System.out.println("Find out what InterruptedException is!");
    }

    and even if the PC has multiple processors you are still not guaranteed that it will run the seperate threads at the same exact moment. The JVM for the platform would have to be optomized to make use of multiprocessors for starters, and even if it is it still doesn't guarantee it, the way the OS handles applications (i.e. the JVM) and the way the JVM handles multithreads all will have implications on whether or not two threads actually truly run simultaniously.

  • How to make the Thread as a Answered

    Dear Support Team,
    How to make  thread as a Answered one , Because  it still showing Not Answered.I want to change the status as a Answered.
    Re: Price Variance hitting PPV account even when there is stock.
    Thanks for our support.
    Regards,
    Thambi.

    You can close this thread by selecting whichever reply you feel is correct as CORRECT ANSWER. OR if you feel there is no proper reply to correct solution, you may also mark your query as Assumed answered.
    Did you not go through How to close a discussion and why
    Regards,
    Jitendra

  • How to make different print jobs from one PC

    Hi
    We have a problem to make 2 different print jobs at same printer with one PC.
    We use Adobe Acrobat X Standard or Acrobat Reader 9 both no sucess.
    we want following
    1. print A4
    2 Print A6
    Program find out itselw when to print A4 or A6 from different location at the same printer or at 2 different printers.
    Bothe print 1 and 2 is PDF file.Print 1 is for invoices - print 2 is for labels
    Is that posibel with Adobe?
    BR
    Flemming

    Hi and welcome to the RoboHelp forums. You may be better placed to ask this question on the Acrobat forums as I expect knowledge about printing PDFs would be limited here. However I suspect that you'll need to set-up different Print Options inside Acrobat to do what you want. This is not my area of expertise though.
      The RoboColum(n)
      @robocolumn
      Colum McAndrew

  • How to make different size images the same size pdf in Acrobat.

    I am trying to place 2 different size images into acrobat to create a pdf but one image is half the size. How do i make each page the same size when the images are different sizes?

    Thank you, I changed the image size to match and then placed them in acrobat.

  • How to make Different Price for same product in one Sale Order

    How can i customizing my system?
    I need to sale for different price same product A in one sale order. And price condition type cant be manually. i can separate them by position. for ex. in first position: product A is one price and in 2nd product A with discount. i tried to do it by changing a price group for 2nd position to determinate a discount condition but it generates invoice split.
    Someone have any suggestions?

    Hi
    you can have it automatically determined after some custo and using userexit_pricing_prepare_tkomp in MV45AFZZ and RV60AFZZ.
    The idea is to use ítem category field (PSTYV) as a part of pricing data to determine different prices for same material by changing manually ítem category when creating a sales order
    - you'll need to create a new ítem category copied from the one you´re using and do all assignments
    - add field PSTYV, if not there, to pricing field catalog. This thread has an example on how to and coding required for userexits
    http://scn.sap.com/thread/1693234
    - Adjust your pricing sequence as per new table
    - Maintain specific prices in new table for materials with this new ítem category
    Finally, when creating a sales order change, when required, default ítem category by new one to get specific price for material.
    Regards,
    JM

  • How to make Different Tracks in a Recording

    HI there ...
    I'm just starting to make my way around GarageBand ...
    I have to do a recording tomorrow ... its an audition for a pianist. He's going to have to play some solos, scales etc ... all told it will be about an hour and a half of recording or more ...
    What I need to know is ..... Every part of the audition has to end up as a different track on the cd I make of it. For example the ten scales has to play would each be a track number ... his solo piece another number and so on.
    How do I mark tracks on the recording? Also ... if I set up the recording and just press record every time he plays ..... am I going to have enough space in the one project to record everything? I thought I read somewhere that garageband has a limit on the number of bars that it can record.
    Thanks so much for any help .......

    I just looked at Amadeus Pro on the web .... Does it do recording too?
    Yes
    How many tracks can it do ....
    I don't think it's actually specified, but lots. (Actually I don't think this is what you are talkin aboujt, it can do numerous simultaneous tracks for mixing down: but yes, you can split a single recording into separate ones.)
    If I record on GarageBand ... can I use Amadeus to
    edit the GarageBand file? ...
    Yes - first export to iTunes then drag the file from iTunes to the desktop and then drag that to the Amadeus Pro icon in the dock.
    .... Cut sections out ... Mark tracks .... and burn a
    CD? ....
    Yes, yes and yes. The program is still in beta and I haven't actually tried the CD burning facility, but in any case you can burn audio CDs from iTunes.

  • How to make different photos come into a frame in a tile-like fashion?

    I've been using Final Cut Pro X for a few months, but mainly have been sticking to the basic stuff. Now, for a video I'm doing, I would like to show 4 or 5 different pictures that dynamically come into the frame in a tile-like fashion.
    I guess the best way to describe this would be: Photo 1 comes in and resides on the top left. Photo 2 comes in and resides on the top right. Photo 3 comes in and resides in the bottom left. Photo 4 comes in and resides in the bottom right. Photo 5 comes in and resides in the middle. (Or if I can't do 5, then just 4 photos).
    The photos are all different (not just a screen tile of one photo).
    I could swear that I learned some sort of technique like this in the Final Cut Pro X book, but I can't remember how in the world to do it.
    Can you guys please give me a jumpstart on this??? This **is** possible in Final Cut Pro X, isn't it? Or will I need to buy some sort of add-on to do this?
    Thank you so much!!!!

    LynnZee wrote:
    This **is** possible in Final Cut Pro X, isn't it? Or will I need to buy some sort of add-on to do this?
    If you want DIY, edit a still into the timeline. Option drag (to duplicate) the clip to the layer immediately above the primary storyline; repeat 3 more times so you have 4 identical clips connected to the original clip on the primary storyline.
    For each clip, select, and resize with the transform function. Reposition as necessary. Either keyframe the moves into the correct position in the frame or keyframe the opacity if you want them to appear sequentially.
    If you want to do it with a plug-in you might look art this or this.
    Russ

Maybe you are looking for