You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I've simulated producer consumer schema with ets_buffer of type 'ring'.
1 writer process which in a loop (without explicit sleep) calls ets_buffer:write
1 reader process which in a loop (without explicit sleep and also with sleep 5 mls)
size of a ring buffer is 200
Is it a situation (returning {missing_ets_data, buffer_name, -N}) which reader should tolerate in some way? If such, then which way is a most correct? Experimentally I've discovered that if I proceed with readings further then after some number of attempts (approx N times) I'll start to receive normal data.
Or it is still a some kind of a concurrency bug, and if such situation occur the ring buffer must be considered as 'broken' and should not be used any more by program? The documentation for 'missing_ets_data' is not clear for me.
The text was updated successfully, but these errors were encountered:
This return value comes if the writer has allocated a place to write, but has not yet written to the slot. The reader retries 3 times with a yield() to give a chance for the writer to finish. This error should not happen, but it is harmless to ignore it and try the read again. The error indicates that the reader is faster than the writer.
Can you post your code so I can see what might be happening?
Hi,
I've simulated producer consumer schema with ets_buffer of type 'ring'.
Is it a situation (returning {missing_ets_data, buffer_name, -N}) which reader should tolerate in some way? If such, then which way is a most correct? Experimentally I've discovered that if I proceed with readings further then after some number of attempts (approx N times) I'll start to receive normal data.
Or it is still a some kind of a concurrency bug, and if such situation occur the ring buffer must be considered as 'broken' and should not be used any more by program? The documentation for 'missing_ets_data' is not clear for me.
The text was updated successfully, but these errors were encountered: