-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
--------- Co-authored-by: Stefan Krastanov <[email protected]> Co-authored-by: Stefan Krastanov <[email protected]>
- Loading branch information
1 parent
c62a6e5
commit bb72add
Showing
13 changed files
with
125 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Base.@deprecate put(args...) put!(args...) | ||
Base.@deprecate put(args...; kwargs...) put!(args...; kwargs...) | ||
#Base.@deprecate request(args...; kwargs...) lock(args...; kwargs...) # Not the same: `request` needs to be yielded, while `lock` yields itself | ||
#Base.@deprecate tryrequest(args...; kwargs...) trylock(args...; kwargs...) # Not the same: `request` needs to be yielded, while `lock` yields itself | ||
Base.@deprecate release(args...; kwargs...) unlock(args...; kwargs...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using ConcurrentSim | ||
|
||
## Containers with Float64 priority | ||
sim = Simulation() | ||
con = Container{Float64}(sim,0) | ||
put!(con, 1; priority = 10) | ||
put!(con, 1; priority = 9.1) | ||
put!(con, 1; priority = UInt(9)) | ||
put!(con, 1; priority = BigInt(8)) | ||
put!(con, 1; priority = BigFloat(7.1)) | ||
put!(con, 1; priority = 7) | ||
put!(con, 1; priority = 6.1) | ||
put!(con, 1; priority = BigInt(5)) | ||
put!(con, 1; priority = BigFloat(-Inf)) | ||
@show keys(con.put_queue) | ||
|
||
## Containers with Int64 priority | ||
sim = Simulation() | ||
con = Container{Int}(sim,0) | ||
put!(con, 1; priority = 10) | ||
put!(con, 1; priority = 9.0) | ||
put!(con, 1; priority = UInt(9)) | ||
put!(con, 1; priority = BigInt(8)) | ||
put!(con, 1; priority = BigFloat(7.0)) | ||
put!(con, 1; priority = 7) | ||
put!(con, 1; priority = 6.0) | ||
put!(con, 1; priority = BigInt(5)) | ||
put!(con, 1; priority = typemin(Int)) | ||
@show keys(con.put_queue) | ||
|
||
## Stores with Float64 priority | ||
sim = Simulation() | ||
sto = Store{Symbol,Float64}(sim; capacity = UInt(5)) | ||
put!(sto, :a; priority = 10) | ||
put!(sto, :a; priority = 9.1) | ||
put!(sto, :a; priority = UInt(9)) | ||
put!(sto, :a; priority = BigInt(8)) | ||
put!(sto, :a; priority = BigFloat(7.1)) | ||
put!(sto, :b; priority = 7) | ||
put!(sto, :b; priority = 6.1) | ||
put!(sto, :b; priority = BigInt(5)) | ||
put!(sto, :b; priority = BigFloat(-Inf)) | ||
@show sto.items | ||
@show keys(sto.put_queue) | ||
|
||
## Stores with Int64 priority | ||
sim = Simulation() | ||
sto = Store{Symbol,Int}(sim; capacity = UInt(5)) | ||
put!(sto, :a; priority = 10) | ||
put!(sto, :a; priority = 9.0) | ||
put!(sto, :a; priority = UInt(9)) | ||
put!(sto, :a; priority = BigInt(8)) | ||
put!(sto, :a; priority = BigFloat(7.0)) | ||
put!(sto, :b; priority = 7) | ||
put!(sto, :b; priority = 6.0) | ||
put!(sto, :b; priority = BigInt(5)) | ||
put!(sto, :b; priority = typemin(UInt)) | ||
@show sto.items | ||
@show keys(sto.put_queue) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters