Alex Szpakowski
0752f27bdf
Update copyright year for 2019
2019-01-03 21:09:05 -04:00
Alex Szpakowski
19890a65c3
Move named channel code to the thread module instead of having a static map. Fixes issue #1464 .
2018-12-31 22:36:36 -04:00
Bart van Strien
e80247c191
Happy new year! ✨
2018-01-03 19:47:35 +01:00
Bart van Strien
09c1259857
Add optional timeout values to Channel:supply and Channel:demand ( resolves #1344 )
...
--HG--
branch : minor
2017-09-11 13:40:21 +02:00
Alex Szpakowski
abb72cb813
Happy new year! 🥂
...
--HG--
branch : minor
2017-01-02 01:28:29 -04:00
Bart van Strien
c761202486
Build type information on first use (load-time), instead of using a hardcoded list
...
--HG--
branch : dynamiccore2
2016-11-13 16:38:57 +01:00
Alex Szpakowski
140faf0cae
Channel:push now returns an id value. Added Channel:hasRead(id), which returns true if the value that the id represents has already been popped, demanded, or cleared from the Channel. Resolves issue #1104 .
...
--HG--
branch : minor
2016-03-09 22:04:14 -04:00
Alex Szpakowski
a0bbcce8ee
The video decoding thread efficiently waits for a video to be created before doing anything, rather than sleeping for 2ms in a loop. Reduces the CPU usage of the video worker thread to ~0% when no videos are loaded.
2016-03-05 21:56:51 -04:00
Alex Szpakowski
e08374fdd1
We don't need a mutex lock in Channel::retain/release... I think.
2016-02-26 18:38:39 -04:00
Alex Szpakowski
23fcaec89f
The Variant class is now meant to be used on the stack instead of allocated on the heap. As a result (and because of related changes), performance of Channels has roughly doubled when pushing and popping most types.
2016-02-14 16:39:32 -04:00
Alex Szpakowski
46a2e7b85c
Happy new year! 🎉
2016-01-01 00:05:06 -04:00
Alex Szpakowski
289eeb4fe0
Added Channel:performAtomic(func, ...). Resolves issue #1034 .
...
performAtomic calls the function and passes the Channel as the first argument, plus any additional specified arguments. The called function should do as little work as possible.
To other threads, all methods for that Channel are executed in a single step inside the function. This can prevent a large number of potiential race conditions.
Example:
-- main.lua:
local function set(channel, value)
channel:clear()
channel:push(value)
return "set value"
end
assert(channel:performAtomic(set, 1) == "set value")
-- thread.lua
while true do
assert(channel:peek() == 1)
end
2015-04-24 23:53:28 -03:00
Alex Szpakowski
c7b45b3505
Updated copyright for the new year
2014-12-31 19:32:43 -04:00
Alex Szpakowski
e4dc533bb2
Minor code cleanup
2014-05-01 14:12:21 -03:00
Alex Szpakowski
3120a0e650
Goodbye 2013, hello 2014!
2014-01-03 17:28:58 -04:00
Alex Szpakowski
8d7e0b5629
Time-travelling license text
2013-06-22 03:14:15 -03:00
Alex Szpakowski
4c616e409b
Renamed ParticleSystem:count, Channel:count, and all getNum* functions to get*Count (issue #602 )
2013-05-03 04:04:44 -03:00
Bart van Strien
c7c5d0ed6b
Fix race conditions and deadlocks in Channels (hopefully) (issue #554 )
...
Also, this is a giant commit because of the official Code Style (tm) was applied.
--HG--
branch : minor
2013-01-30 17:15:12 +01:00
Bart van Strien
be2363fc00
Add Channel:supply(), a blocking version of Channel:push()
...
--HG--
branch : minor
2013-01-27 20:04:16 +01:00
Bart van Strien
3dc4e3cdca
Also mutex lock in Channel::retain
...
--HG--
branch : minor
2012-07-05 17:25:41 +02:00
Bart van Strien
777e97de2e
Make Channels more thread-safe (I know, I know..)
...
--HG--
branch : minor
2012-07-04 20:22:54 +02:00
Bart van Strien
399a6a6614
Merge in channels from love-experiments
...
Rewritten love.thread and changed communication
method from weird system before, to channels.
--HG--
branch : minor
2012-07-04 17:15:16 +02:00