Re: prevent threads with a sequential task running parralelly to update table in a sequential manner

From: Jerry Stuckle <jstucklex_at_attglobal.net>
Date: Sun, 19 Mar 2017 15:07:56 -0400
Message-ID: <oamkoo$ef8$1_at_jstuckle.eternal-september.org>


On 3/19/2017 2:35 AM, kushal bhattacharya wrote:
> Hi,
> The issue i am facing right now is,I am runnig threads parralllely and according in these parrallel threads i am performing some sort of sequential updation on the table.To explain the scenario i am working on mqtt.So suppose i sending a packet as PUBRECV,then it should update the previous state to PUBRECV .After that the client sends PUBREL packet which is recieved by my program which then sends PUBCOMP packet and deletes that entry from the row.But what i am facing is when i am sending PUBRECV packet to client on the true value i am upting the entry and before this updation has been done the PUBREL packet comes along and searches for that updated entry and finds none since its not done till now.So How can i do this sequential operation on the table itself?
> Thanks,
> Kushal
>

This has nothing to do with MySQL. You need to learn how to work in a multi-threading environment. If you need sequential operations like this, you must handle it in your code.

Remember that in a multithreading environment, you cannot guarantee in which order threads will run unless you do the ordering yourself.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex_at_attglobal.net
==================
Received on Sun Mar 19 2017 - 20:07:56 CET

Original text of this message