首先在ns3.25/examples/tutorial/下找到 first.cc文件,将他拷贝到到scratch目录下. 然后为了方便将代码打出来 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU
两个线程(Thread)调用同一个对象(使用Runnable接口的对象ThreadJob) 误区:下一个线程会从上一个线程结束的地方开始 正解:如 public domd implements Runnable{ int blance = 0; public void run{ for(int i = 0; i < 50; i++){ blance++; } } } domd runner = new domd(); Thread t = new Thread(runner); Thread t