queue.sync thread : exc_bad_instruction (code=exc_i386_invop, subcode=0x0)

0
235

“queue.sync” is a C runtime call. The call returns immediately (asynchronous) and returns a zero value if an error occurs. This thread is a “queue.sync” thread.

A queue.sync is basically a thread. The thread is a synchronous call, it waits for the other thread to complete its work and then returns with the answer. It is a non-blocking thread. The non-blocking part of the thread does not block. The thread is scheduled for execution as soon as it is ready. The thread’s return value is a zero value if an error occurs in its routine.

For more information on the Queue sync, see the guide here.

So how does the queue thread work? Well, it’s a really simple thing. The thread waits for the other thread to complete its work, then returns its answer. While the other thread is waiting, it uses a non-blocking version of the system call to return the answer to the caller, waiting for the other thread to complete its work. If the other thread completes its work, then the system call returns its answer with a zero value. The queue thread is then scheduled for execution.

As you noticed, the queue thread is a non-blocking system call. This means that it’s safe to return a value from the system call even if the other thread is still waiting for its answer. On the other hand, the call is non-blocking because it goes to the kernel to find out if a thread is still busy, then it’s safe to return a value from the system call.

I’m always surprised how quickly the system call returns. I don’t have a good explanation for this, but it seems like the system call makes an attempt to finish the other thread’s work before going and executing the thread’s own system call. The reason for this is probably that when the thread’s system call returns, it’s essentially an interrupt to the system call.

The way this story looks is as follows. In the first story, the party-lovers are on a busy island, and they’re waiting for the party-lovers to return. That’s the system call.

The system call returns when the system call returns…

When they return, the party-lovers start a new thread, the “queue” thread. They’re waiting for the party-lovers to finish their “queue” thread. The system call returns when the system call returns…

LEAVE A REPLY

Please enter your comment!
Please enter your name here