??????????????д??????????????е????????oracle??????У??????????????????????????????????????????е???ν????????????????????

??????????????????????????????????????????У???д??????????????????????????????????????????????????????????????????????????System.currentTimeMillis???????????????????????????????????????????????????????????????

long tStart = System.currentTimeMillis????;  

    System.out.println??Thread.currentThread????.getName???? + "???"??;//????????? 
    for ??int ii = 0; ii < threadNum; ii++?? {//??threadNum????? 
    Runnable r = new Runnable????{  
    ??Override 
    public void run????{  
    System.out.println??Thread.currentThread????.getName???? + "???"??;  
    //???Щ????... ... 
    System.out.println??Thread.currentThread????.getName???? + "????."??;  
    }  
    }  
    Thread t = new Thread??r??;  
    t.start????;  
    }  
    System.out.println??Thread.currentThread????.getName???? + "????."??;//?????????? 
    long tEnd = System.currentTimeMillis????;  
    System.out.println??"??????:"+ ??tEnd - tStart?? + "millions"??;

    long tStart = System.currentTimeMillis????;
    System.out.println??Thread.currentThread????.getName???? + "???"??;//?????????
    for ??int ii = 0; ii < threadNum; ii++?? {//??threadNum?????
    Runnable r = new Runnable????{
    ??Override
    public void run????{
    System.out.println??Thread.currentThread????.getName???? + "???"??;
    //???Щ????... ...
    System.out.println??Thread.currentThread????.getName???? + "????."??;
    }
    }
    Thread t = new Thread??r??;
    t.start????;
    }
    System.out.println??Thread.currentThread????.getName???? + "????."??;//??????????
    long tEnd = System.currentTimeMillis????;
    System.out.println??"??????:"+ ??tEnd - tStart?? + "millions"??;

??????????????for???????????????????????????????????????????е?????????????е??????????????????????У??????????????????????????"????????????????????????"??????????????????????t.join????????????????????????У??????????????????????????????????

????????Google????????????????????????????????????????????????????????????????????????????...

????????????????????????ImportThread??????java.lang.Thread??????run???????????????List??????????в????????????????ж????List????????????????????????????????????????£?

public class ImportThread extends Thread {  

    private static List<Thread> runningThreads = new ArrayList<Thread>????;  
    public ImportThread???? {  
    }  
    ??Override 
    public void run???? {  
    regist??this??;//????????? 
    System.out.println??Thread.currentThread????.getName???? + "???..."??;//????????? 
    //???Щ????... ... 
    unRegist??this??;//????????????? 
    System.out.println??Thread.currentThread????.getName???? + "????."??;//?????????? 
    }  
    public void regist??Thread t??{  
        synchronized??runningThreads??{   
            runningThreads.add??t??;  
        }  
    }  
    public void unRegist??Thread t??{  
        synchronized??runningThreads??{   
            runningThreads.remove??t??;  
        }  
    }  
    public static boolean hasThreadRunning???? {  
    return ??runningThreads.size???? > 0??;//????ж?runningThreads???????????????????δ????? 
    }  
    }

    public class ImportThread extends Thread {
    private static List<Thread> runningThreads = new ArrayList<Thread>????;
    public ImportThread???? {
    }
    ??Override
    public void run???? {
    regist??this??;//?????????
    System.out.println??Thread.currentThread????.getName???? + "???..."??;//?????????
    //???Щ????... ...
    unRegist??this??;//?????????????
    System.out.println??Thread.currentThread????.getName???? + "????."??;//??????????
    }
    public void regist??Thread t??{
        synchronized??runningThreads??{
            runningThreads.add??t??;
        }
    }
    public void unRegist??Thread t??{
        synchronized??runningThreads??{
            runningThreads.remove??t??;
        }
    }
    public static boolean hasThreadRunning???? {
    return ??runningThreads.size???? > 0??;//????ж?runningThreads???????????????????δ?????
    }
    }