Where did I screw up trying concurrency?

I tried making a concurrency-safe data queue. It was going well, until memory check tests crashed.

It's part of an unadvertised git project. Its location is:

https://github.com/CTMacUser/SynchronizedQueue/commit/84a476e8f719506cbd4cc6ef513313e4e489cae3

It's the blocked-off method "`memorySafetyReferenceTypes'" in "SynchronizedQueueTests.swift."

Note that the file and its tests were originally AI slop.

Answered by DTS Engineer in 874548022

It’s better to reply as a reply, rather than in the comments; see Quinn’s Top Ten DevForums Tips for this and other titbits.

It's now public

Cool.

That’s some pretty complicated code. What are you actually trying to achieve here?

Looking at the interface for SynchronizedQueue, it seems like you’re creating an actor with enqueue and dequeue semantics. You then have a world of unsafe code to implement a linked list. Could you perhaps replace that with the Deque type from Swift Collections.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I can’t see your code. It seems that your SynchronizedQueue repo is not public.

% curl -f https://github.com/CTMacUser/SynchronizedQueue
curl: (56) The requested URL returned error: 404

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

It’s better to reply as a reply, rather than in the comments; see Quinn’s Top Ten DevForums Tips for this and other titbits.

It's now public

Cool.

That’s some pretty complicated code. What are you actually trying to achieve here?

Looking at the interface for SynchronizedQueue, it seems like you’re creating an actor with enqueue and dequeue semantics. You then have a world of unsafe code to implement a linked list. Could you perhaps replace that with the Deque type from Swift Collections.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Where did I screw up trying concurrency?
 
 
Q