473,386 Members | 1,943 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

multithreading - managing transactions and sequence of processing

Hello there

question: I'm looking for information / patterns / recipe's for
implementing a multi threaded program (multiple producers / consumers)
that will manage transactions and maintain sequence across the different
threads.

background:
I'm busy writing an adapter taking messages from ibm websphere mq using
pymqi and inserting these messages into a database (after some
processing, the messages come in as xml). If I comment out the database
..execute bit of the code, i process hundreds of messages per second, the
database slows the whole process down to around 60 - 100 messages per
second. I'm hoping to speed this up some by having 2 threads reading the
messages from mq, and another populating the database - at least then
the database bit will never have to wait for me to fetch another
message. (i'm thinking of later adding a second thread for the databse
as well).

The challenge is that these messages need to be processed in exact
sequence and transactionally. (ie. the thread that fetched a message
will have to wait for confirmation that the message has successfully
been inserted into the database before committing the transaction, in mq
terms the message will only really be deleted then.)

I've started implementing a kind of state machine using dictionary's to
facilitate this, but I'm now concerned that
- there is a better way
- i might get bitten with dictionary processing updating / setting of
values not necessarily being thread safe.

I've looked at this recipe
http://aspn.activestate.com/ASPN/Coo.../Recipe/302997 as a
possible replacement for dictionary's but I'm not even sure if I'm using
it correctly.

thank you
jaco




May 22 '06 #1
0 1170

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Richard Maher | last post by:
Hi, I am seeking the help of volunteers to test some software that I've developed which facilitates distributed two-phase commit transactions, encompassing any resource manager (e.g. SQL/Server...
1
by: dixp | last post by:
I'm new to writing multithreaded apps and I have a design question. I have a winforms app and a class which has a method that does processing which is time intensive. I want the user to be able...
11
by: Mark Yudkin | last post by:
The documentation is unclear (at least to me) on the permissibility of accessing DB2 (8.1.5) concurrently on and from Windows 2000 / XP / 2003, with separate transactions scope, from separate...
16
by: Robert Zurer | last post by:
Can anyone suggest the best book or part of a book on this subject. I'm looking for an in-depth treatment with examples in C# TIA Robert Zurer robert@zurer.com
9
by: tommy | last post by:
hi, i have found a example for multithreading and asp.net http://www.fawcette.com/vsm/2002_11/magazine/features/chester/ i want to speed up my website ... if my website is starting, they...
5
by: MS Newsgroups | last post by:
Hi, I have an application that runs a timer and executes a method in a class as a new thread every 60 seconds, the thread takes 65 seconds to execute so there is a 5 second overlap when 2...
28
by: JV | last post by:
My ASP.NET application needs to accept data from a post and return quickly. I've added a worker thread to wake up and save data asynchronously after the data is received. But, it appears to me...
1
by: RSH | last post by:
Hi, I have a situation in where I have a main loop that queries a "Parent" Global database table. Based on that resultset I loop through all of the databases and the appropriate table in the...
19
by: jupiter | last post by:
Hi guys!!! Just one quick question... Which database module should I use when I want to use multi threading as my application requires lots of data from internet ???? I also want this database...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.