I am using task queue for certain data updation in GAE.
My queue.xml file look like below
<queue>
<name>data-processing</name>
<rate>20/s</rate>
</queue>
My queue processing servlet decrease credit by 1 for every task. While processing it need to check for credit availability and proceed further only if credit is available.
The credit is stored in a table and it get updated when a task is completed.
I see the tasks as threads and worried about synchonization problem.
what if 2 or more tasks query/update credit table simultaniously? Do i need to create some locking mechenism? If yes then how?