typelift / concurrent Goto Github PK
View Code? Open in Web Editor NEWFunctional Concurrency Primitives
Functional Concurrency Primitives
Use dispatch_* instead.
Or at least reduce it.
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?
Also move away from Basis-style purity.
Parallel to typelift/Swiftz#165
I'd be cool to also add Cocoapods support. I done this implementation myself last month for my library. Just follow this post and this checklist.
Killed threads do not remove themselves from the reader or writer queue.
In Haskell, I can use System.Timeout from base. How do I do it in Swift?
swift build
complains about test directory layout. It's already fixed in master, please make a new release.
/// 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.
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")
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.