Menu

#105 Advanced synchronization of per-class data

open
nobody
5
2012-10-05
2012-10-05
No

This will enable using static fields from different types in non-kernel device-side static/instance methods.

As virtualization is not supported device-side, and each device-side methods knows which other methods it calls and which fields it accesses, the full set of classes requiring synchronization can be determined. In fact, it is computed using a standard transitive closure algorithm.

Computing set of classes for synchronization by each kernel can be best done when device program is compiled, i.e. at runtime, with data prepared at compile time.

At compile time, a unique id is generated for each device-side method, and encoded in an attribute of that method. For each method, the other methods it calls and the names of the classes which require synchronization because they are referenced by this method directly are encoded as well.

At run time, classes requiring synchronization for each kernel call are determined by our algorithm. The trees starting at classes are synchronized before each kernel call, and are invalidated after each kernel call.

In future, access to static class fields in kernels can be implemented using this method as well.

Discussion

MongoDB Logo MongoDB