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
I made a comment on the article you originally posted this in but I thought I'd put this here too.
Whislt queues are - as you say - threadsafe, the array you're holding them in is NOT threadsafe...
Sooner or later you'll see "index out of range" errors - either when reading through (backwards) or deleting array elements...
Adding another exception to "ignore" this is probably fine - another thread just did the work - but it caught-me-out when I moved from the development to a proper 'threaded' webserver (it took many hours to happen - but then happened 10 times in a single day!!)
The text was updated successfully, but these errors were encountered:
Thanks for pointing this out! I didn't think about this when I wrote this back in 2020. I agree with what @neojaw mentions here, in that a lock should be used. I think that's cleaner than catching exceptions coming from race conditions.
I'll leave this issue open so people have an easier way finding it :)
I made a comment on the article you originally posted this in but I thought I'd put this here too.
Whislt queues are - as you say - threadsafe, the array you're holding them in is NOT threadsafe...
Sooner or later you'll see "index out of range" errors - either when reading through (backwards) or deleting array elements...
Adding another exception to "ignore" this is probably fine - another thread just did the work - but it caught-me-out when I moved from the development to a proper 'threaded' webserver (it took many hours to happen - but then happened 10 times in a single day!!)
The text was updated successfully, but these errors were encountered: