Descriptive Problem Summary:
When two 'threads' (spawn) exchange large quantities of references to objects (lists, datums, etc) through a queue list accessible to both, the console gets 'Bad ref' output
Numbered Steps to Reproduce Problem:
Run the below code.
Observe that the console is rapidly filled with "BUG: Bad ref [...]"
Code Snippet (if applicable) to Reproduce Problem:
var/list/queue = list()
/world
New()
spawn produce()
spawn consume()
proc/consume()
while(1)
sleep(1)
for(var/i = 1 to 100)
if(queue.len)
// do something with queue[1]
queue.Cut(1,2)
proc/produce()
while(1)
// does NOT happen if this is less than 5 (???), reliably happens if it's 5 or larger
for(var/i = 1 to 5)
/* does NOT happen if this is not a reference (tested with list, datum, number
* and string; only list/datum produce bad ref output), though it can be the same
* reference every time; if it is the same every time, the bad ref applies also
* to produce(), if it differs it is only consume()
*/
queue[++queue.len] = list()
sleep(1)
Expected Results: No 'Bad ref' output
Actual Results: Lots of 'Bad ref' output
Does the problem occur:
Every time? Or how often? Every time
In other games? Irrelevant
In other user accounts? Not tested
On other computers? Not tested
When does the problem NOT occur? When the queue contains less than 5 objects???
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? Unknown
Workarounds: None
edit:
varying reference - 3+ for a single, 5+ for a spam
constant reference - 3+ for a spam
double edit: mob and obj references behave identically