For each file in a given directory, the Master created a WorkUnit, providing it with location of the file it was to process.
对于指定目录下的每个文件,Master都创建一个WorkUnit,向它提供要处理的文件的位置。
From a performance perspective, we didn't want Terracotta to have to synchronize access to these WorkUnit attributes if the Master will never access them.
从性能角度来看,如果Master永不访问WorkUnit的属性,那么我们是不希望Terracotta对这些属性的访问进行同步的。
For in a more realistic and complex example, the WorkUnit may have many instance variables that are really only relevant when it is being run by the Worker.
举一个更为现实和复杂的例子,WorkUnit可能有很多实例变量,它们实际上只在由Worker运行的时候才是相关的。
应用推荐