t1:I had to kill it.
This line was repeated about 1900 times:
wating... 23:00:05

t2:
Here it consistently exits after a few seconds.
Displaying the two kind of strings in random order,
sometimes the same two times.

Version: 1.82.294, CPU: P4HT

Brgds,
Viktor

On Mon, Jun 22, 2009 at 10:54 PM, Przemyslaw Czerpak <[email protected]>wrote:

> Hi,
>
> I've downloaded from internet some xbase++ documentation and I'm
> wondering how some things really works. Maybe I'm wrong but IMHO
> few things cannot work as described. Also some results from previous
> tests had some strange for me anomalies.
> I would like to ask xbase++ users to make some tests with this
> language to find answers for some questions.
>
> 1-st I would like to check how looks simultaneous execution in xbase++.
> Some things suggest that xbase++ uses rather task switching instead
> of simultaneous execution. the task switching is done on function call.
> This simple test should give us the answer.
>
>   proc main()
>      local o, h, n
>      h := fcreate( "_out_.txt" )
>      ? date(), time(), os(), version()
>      o:=thread():new()
>      o:start("F")
>      n := seconds()
>      while seconds() - n < 3
>         fwrite( h, "wating... " + time() + chr( 13 ) + chr( 10 ) )
>      enddo
>      fclose(h)
>      wait
>   return
>   func f()
>      local n := 0
>      while .t.
>         // dummy loop without any function call
>         ++n
>      enddo
>   return nil
>
> if xbase++ does not end automatically after 3 seconds then please
> kill the application and check _out_.txt results. It can be long
> but I'm interesting only in unique lines, f.e. output from
>   sort -u _out_.txt
> If you do not have sort program in your OS then the 1-st and the
> last line from _out_.txt should be enough.
>
> The second thing I would like to test is write access to the same
> item from different threads.
>
>   static s_x := NIL
>   proc main()
>      local o1, o2
>      o1:=thread():new()
>      o1:start("f1",3)
>      o2:=thread():new()
>      o2:start("f2",4)
>      while inkey(1)!=27
>         ? valtype(s_x), s_x
>      enddo
>      wait
>   return
>   func f1( n )
>      while .t.
>         s_x := { repl( "#@", n ), { repl( "!", n ) } }
>      enddo
>   return nil
>   func f2( n )
>      while .t.
>         s_x := repl( "*", n * 5 )
>      enddo
>   return nil
>
> I'm interesting if the above code can work without any errors for
> some longer time, f.e. 1 minute.
> If not then I'm interesting if errors are repeatable if the application
> is executed few times.
>
> If you have a while please make the above test and send results to this
> list. It's possible the they will be different on real multiCPU machines
> so I'm interesting in seeing results from different xbase++ installations.
> Many thanks for your time and results if any.
>
> best regards,
> Przemek
> _______________________________________________
> Harbour mailing list
> [email protected]
> http://lists.harbour-project.org/mailman/listinfo/harbour
>
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to