On 05/19/2014 01:58 AM, user wrote:
>>From the docs I understand that the usual method would be:
>
> every [(GEN) do] put(L1,thread put(L2,gen()))
>
I tried the following and got the results I'd expect:
procedure main()
L2 := mutex([])
L1 := []
every 1 to 3 do put(L1, thread (put(L2, 1 to 5),delay(?200)))
every wait(!L1)
every writes(" "||!L2 | "\n")
end
The delay is in there because the simple gen() [1 to 5] I used is so
fast that without the delay each thread completes before the next
gets created and run!
sample runs:
------------------------------------------
->t
1 1 1 2 2 2 3 4 3 3 4 4 5 5 5
->t
1 1 1 2 2 2 3 3 4 5 3 4 5 4 5
->t
1 1 1 2 2 3 2 3 4 3 4 5 5 4 5
->
-----------------------------------------
Are you expecting/getting something different?
Just for fun, the following variants of the key expression also work:
every put(L1, |(thread (put(L2, 1 to 5),delay(?200)))\3)
L1 := [: |(thread (put(L2,1 to 5),delay(?200)))\3 :]
--
Steve Wampler -- [email protected]
The gods that smiled on your birth are now laughing out loud.
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Unicon-group mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/unicon-group