function  task1() {
     m1.moveRel(1.0)
     return m1.getPosition()
 }
function  task2() {
     m2.moveRel(1.0)
     return m2.getPosition()
 }

function  task3() {     
     return ai1.read()
 }

function moveRelative(args){
    var motor = args[0]
    var step = args[1]    
    print ("Moving " + m1.getName() + " step = " + step)
    m1.moveRel(step)
    return m1.getPosition()
}


ret = parallelize(task1, task2, task3)

//ret = fork(task1, task2, task3)
//print (ret)
//ret = join(ret)


//ret = parallelize([moveRelative,[motor,1]], [moveRelative,[motor2,1]])


print (ret)
