Giter Club home page Giter Club logo

concurrent's People

Contributors

codafi avatar dduan avatar e28eta avatar lfarah avatar mpurland avatar pthariensflame avatar ypogribnyi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

concurrent's Issues

Installation section

Hey @typelift, your library is really interesting.

The only problem I found was the README.md, which is a little bit confusing.
I created this iOS Open source Readme Template so you can take a look on how to better organize.
If you want, I can help you to organize the lib.

What are your thoughts?

Swap is not atomic, is this by design?

/// Atomically, take a value from the `MVar`, put a given new value in the
/// `MVar`, then return the `MVar`'s old value.
public func swap(_ x : A) -> A {
	let old = self.take()
	self.put(x)
	return old
}

The thread using swap might context-switch right after the take completes before the put -- if another thread puts then, this put will block.

Using transactions from multiple threads

Hi,
I am trying to use the STM system to run simultaneous transactions from multiple threads.
Unfortunately it seems either my usage is incorrect, or my understanding of the API is.
Can you please help me out ?

Code :

for _ in 1...3 {
    Thread {
	let _ =
		transfer(from: alice, to: bob, amount: 100)
		.then(transfer(from: bob, to: alice, amount: 20))
		.then(deposit(into: bob, amount: 1000))
		.then(transfer(from: bob, to: alice, amount: 500))
		.atomically()
    }.start()
}

Result :
If fails on this pre-condition

precondition(transactionEnterSucceed, "Transaction already running on current thread")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.