mirror of
https://github.com/corda/corda.git
synced 2025-04-10 04:40:33 +00:00
Add a lock to `StateMachineState`, allowing every flow to lock themselves when performing a transition or when an external thread (such as `killFlow`) tries to interact with a flow from occurring at the same time. Doing this prevents race-conditions where the external threads mutate the database or the flow's state causing an in-flight transition to fail. A `Semaphore` is used to acquire and release the lock. A `ReentrantLock` is not used as it is possible for a flow to suspend while locked, and resume on a different thread. This causes a `ReentrantLock` to fail when releasing the lock because the thread doing so is not the thread holding the lock. `Semaphore`s can be used across threads, therefore bypassing this issue. The lock is copied across when a flow is retried. This is to prevent another thread from interacting with a flow just after it has been retried. Without copying the lock, the external thread would acquire the old lock and execute, while the fiber thread acquires the new lock and also executes.
…
…
…
Corda
Corda is an open source blockchain project, designed for business from the start. Only Corda allows you to build interoperable blockchain networks that transact in strict privacy. Corda's smart contract technology allows businesses to transact directly, with value.
Features
- Smart contracts that can be written in Java and other JVM languages
- Flow framework to manage communication and negotiation between participants
- Peer-to-peer network of nodes
- "Notary" infrastructure to validate uniqueness and sequencing of transactions without global broadcast
- Enables the development and deployment of distributed apps called CorDapps
- Written in Kotlin, targeting the JVM
Getting started
- Read the Getting Started documentation
- Run the Example CorDapp
- Read about Corda's Key Concepts
- Follow the Hello, World! tutorial
Useful links
- Project Website
- Mailing List
- Documentation
- Stack Overflow Tag
- Slack Channel
- Meetups
- Training Courses
Contributing
Corda is an open-source project and contributions are welcome!
To find out how to contribute, please see our contributing docs.
License
Acknowledgements
YourKit supports open source projects with its full-featured Java Profiler.
YourKit, LLC is the creator of YourKit Java Profiler and YourKit .NET Profiler, innovative and intelligent tools for profiling Java and .NET applications.
Languages
Kotlin
94.3%
Java
2.5%
C++
2.1%
Python
0.3%
Shell
0.3%
Other
0.3%