Search Results

Search found 2 results on 1 pages for 'tecuhtli'.

Page 1/1 | 1 

  • definition of wait-free (referring to parallel programming)

    - by tecuhtli
    In Maurice Herlihy paper "Wait-free synchronization" he defines wait-free: "A wait-free implementation of a concurrent data object is one that guarantees that any process can complete any operation in a finite number of steps, regardless the execution speeds on the other processes." www.cs.brown.edu/~mph/Herlihy91/p124-herlihy.pdf Let's take one operation op from the universe. (1) Does the definition mean: "Every process completes a certain operation op in the same finite number n of steps."? (2) Or does it mean: "Every process completes a certain operation op in any finite number of steps. So that a process can complete op in k steps another process in j steps, where k != j."? Just by reading the definition i would understand meaning (2). However this makes no sense to me, since a process executing op in k steps and another time in k + m steps meets the definition, but m steps could be a waiting loop. If meaning (2) is right, can anybody explain to me, why this describes wait-free? In contrast to (2), meaning (1) would guarantee that op is executed in the same number of steps k. So there can't be any additional steps m that are necessary e.g. in a waiting loop. Which meaning is right and why? Thanks a lot, sebastian

    Read the article

  • C++ template-function -> passing a template-class as template-argument

    - by SeMa
    Hello, i try to make intensive use of templates to wrap a factory class: The wrapping class (i.e. classA) gets the wrapped class (i.e. classB) via an template-argument to provide 'pluggability'. Additionally i have to provide an inner-class (innerA) that inherits from the wrapped inner-class (innerB). The problem is the following error-message of the g++ "gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)": sebastian@tecuhtli:~/Development/cppExercises/functionTemplate$ g++ -o test test.cpp test.cpp: In static member function ‘static classA<A>::innerA<iB>* classA<A>::createInnerAs(iB&) [with iB = int, A = classB]’: test.cpp:39: instantiated from here test.cpp:32: error: dependent-name ‘classA::innerA<>’ is parsed as a non-type, but instantiation yields a type test.cpp:32: note: say ‘typename classA::innerA<>’ if a type is meant As you can see in the definition of method createInnerBs, i intend to pass a non-type argument. So the use of typename is wrong! The code of test.cpp is below: class classB{ public: template < class iB> class innerB{ iB& ib; innerB(iB& b) :ib(b){} }; template<template <class> class classShell, class iB> static classShell<iB>* createInnerBs(iB& b){ // this function creates instances of innerB and its subclasses, // because B holds a certain allocator return new classShell<iB>(b); } }; template<class A> class classA{ // intention of this class is meant to be a pluggable interface // using templates for compile-time checking public: template <class iB> class innerA: A::template innerB<iB>{ innerA(iB& b) :A::template innerB<iB>(b){} }; template<class iB> static inline innerA<iB>* createInnerAs(iB& b){ return A::createInnerBs<classA<A>::template innerA<> >(b); // line 32: error occurs here } }; typedef classA<classB> usable; int main (int argc, char* argv[]){ int a = 5; usable::innerA<int>* myVar = usable::createInnerAs(a); return 0; } Please help me, i have been faced to this problem for several days. Is it just impossible, what i'm trying to do? Or did i forgot something? Thanks, Sebastian

    Read the article

1