Here cool and easy wrapper for love threads, used some like actor model.
Every channel use full-duplex connection to main and other threads.
Reference here:
https://bitbucket.org/MainTomato/toolch ... ?at=master
Looped message passing example:
Love thread wrapper
Love thread wrapper
- Attachments
-
- Thread ring.love
- (4.3 KiB) Downloaded 287 times
Last edited by HDPLocust on Mon May 15, 2017 9:17 am, edited 2 times in total.
Science and violence
- zorg
- Party member
- Posts: 3468
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Love thread wrapper
You really should have mentioned this tidbit:
Unless that's not true, that is. But yeah, 2, almost 3 versions behind the current.Thread library for LOVE2d v0.8
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Love thread wrapper
Oh, it works for love v0.9 - 0.10.2.
v0.8 is library version.
Thanks, readme updated.
Last edited by HDPLocust on Sun May 14, 2017 10:20 pm, edited 1 time in total.
Science and violence
- zorg
- Party member
- Posts: 3468
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Love thread wrapper
Oh, my mistake then! Apologies.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Love thread wrapper
Is newproxy really necessary? Couldn't __gc be set on the thread userdata instead of the table it's in?
If that doesn't work, at least localize setmetatable so the library won't overwrite the global setmetatable.
If that doesn't work, at least localize setmetatable so the library won't overwrite the global setmetatable.
Re: Love thread wrapper
Yes, i think about fix it. Newproxy works, and setmetatable will not be overwritten in next release.
But now, for average using threads, is okay.
Science and violence
Who is online
Users browsing this forum: Google [Bot] and 8 guests