A long transaction is a transaction which contains multiple atomic transactions and is longer in executing time. The serial execution for the atomic transactions not only costs longer executing time for the long transaction but also occupies more
system resources and causes the reduction of the running efficiency of the
system. The invention discloses a
multithreading-based parallel executing method for a long transaction, which comprises the following steps: (1) formally describing the long transaction as an expanding
directed graph; (2)
cutting LT (Language Transaction) into a plurality of sub-transactions LT capable of being executed in a parallel form and giving a
cutting algorithm; (3) deriving a plurality of sub-threads on the basis of
POSIX (Portable
Operating System Interface of
Unix) threading
library (or Windows threading API (Application Program Interface)), so as to execute the long transaction in a parallel embedding mode; and (4) running paralleled codes on a multi-core processor (or a multi-CPU (
Central Processing Unit) processor). According to the
multithreading-based parallel executing method for the long transaction, the executing time for the long transaction is obviously shortened, the executing efficiency for the long transaction is increased, and the method can be applied to the fields, such as SOA (
Service Oriented Architecture), service combination, transaction treatment, and the like.