Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel fill is broken #346

Open
walterbender opened this issue Dec 15, 2017 · 4 comments
Open

Parallel fill is broken #346

walterbender opened this issue Dec 15, 2017 · 4 comments
Labels

Comments

@walterbender
Copy link
Member

Four turtles drawing filled shapes at once interfere with each other. Individually they draw properly. There must be some common state in the fill code that should be local to each turtle.

[[0,["start",{"collapsed":false,"xcor":99.99999999999986,"ycor":-173.20508075688772,"heading":210,"color":100,"shade":50,"pensize":1,"grey":100}],79,85,[null,16,null]],[1,["forward",{}],914.5,273,[3,2,34]],[2,["number",{"value":200}],993.01708984375,273,[1]],[3,["right",{}],914.5,241.5,[31,4,1]],[4,["number",{"value":90}],988,241.5,[3]],[5,["right",{}],941.5,367.5,[9,6,7]],[6,["number",{"value":120}],1015,367.5,[5]],[7,["forward",{}],941.5,399,[5,8,null]],[8,["number",{"value":200}],1020.01708984375,399,[7]],[9,["repeat",{}],928,336,[34,10,5,null]],[10,["number",{"value":3}],1000,336,[9]],[11,["setxy",{}],235.5,161,[37,12,13,20]],[12,["number",{"value":0}],309,161,[11]],[13,["number",{"value":200}],309,192.5,[11]],[14,["action",{"collapsed":false}],901,75,[null,15,33,null]],[15,["text",{"value":"Triangle"}],995.5,84,[14]],[16,["nameddo",{"value":"Triangle"}],92.5,125.5,[0,null]],[17,["start",{"collapsed":false,"xcor":99.99999999999986,"ycor":-73.20508075688772,"heading":210,"color":100,"shade":50,"pensize":1,"grey":100}],98,334,[null,39,null]],[18,["start",{"collapsed":false,"xcor":99.99999999999986,"ycor":-273.2050807568877,"heading":210,"color":100,"shade":50,"pensize":1,"grey":100}],316,318,[null,38,null]],[19,["start",{"collapsed":false,"xcor":99.99999999999986,"ycor":26.794919243112247,"heading":210,"color":100,"shade":50,"pensize":1,"grey":100}],222,89,[null,37,null]],[20,["nameddo",{"value":"Triangle"}],235.5,224,[11,null]],[21,["nameddo",{"value":"Triangle"}],111.5,469,[26,null]],[22,["nameddo",{"value":"Triangle"}],329.5,453,[23,null]],[23,["setxy",{}],329.5,390,[38,24,25,22]],[24,["number",{"value":0}],403,390,[23]],[25,["number",{"value":-100}],403,421.5,[23]],[26,["setxy",{}],111.5,406,[39,27,28,21]],[27,["number",{"value":0}],185,406,[26]],[28,["number",{"value":100}],185,437.5,[26]],[29,["setcolor",{}],914.5,178.5,[44,30,31]],[30,["number",{"value":100}],999.689453125,178.5,[29]],[31,["settranslucency",{}],914.5,210,[29,32,3]],[32,["number",{"value":75}],1051.3837890625,210,[31]],[33,["hidden",{}],914.5,115.5,[14,36]],[34,["fill",{}],914.5,304.5,[1,9,35]],[35,["hidden",{}],914.5,493.5,[34,40]],[36,["pendown",{}],914.5,115.5,[33,44]],[37,["penup",{}],235.5,129.5,[19,11]],[38,["penup",{}],329.5,358.5,[18,23]],[39,["penup",{}],111.5,374.5,[17,26]],[40,["right",{}],914.5,493.5,[35,41,42]],[41,["number",{"value":120}],988,493.5,[40]],[42,["forward",{}],914.5,525,[40,43,null]],[43,["number",{"value":200}],993.01708984375,525,[42]],[44,["setpensize",{}],914.5,147,[36,45,29]],[45,["number",{"value":1}],1023.04638671875,147,[44]],[46,2,[0,"penup"]],[47,2,[0,"setxy",0,200]],[48,2,[0,"pendown"]],[49,2,[0,"setpensize",1]],[50,2,[0,"setcolor",100]],[51,2,[0,"settranslucency",75]],[52,2,[0,"right",90]],[53,2,[0,"forward",200]],[54,2,[0,"fill"]],[55,2,[0,"right",120]],[56,2,[0,"forward",200]],[57,2,[0,"right",120]],[58,2,[0,"forward",200]],[59,2,[0,"right",120]],[60,2,[0,"forward",200]],[61,2,[0,"fill"]],[62,2,[0,"right",120]],[63,2,[0,"forward",200]]]
@sanatankc
Copy link
Contributor

I am not able to reproduce the bug.

Can you mention steps to reproduce the bug?

@walterbender
Copy link
Member Author

Did you try running the code attached? /me tries again now.

parallel is messed up (hitting run button). sequential (clicking one start at a time works)

screenshot from 2017-12-21 08-22-35
screenshot from 2017-12-21 08-23-06

@walterbender
Copy link
Member Author

Looking at the code, since the graphics context is shared, they collide. I suspect some locking mechanism may help but may also degrade performance.

@sanatankc
Copy link
Contributor

making sperate context might also help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants