N[      !"# $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q RSTUVWXYZA %, or attempt to acquire or release a . [<A resource pool, parameterized against arbitrary user data. \]^_1Create a new Room with some arbitrary user data. $Get the user data associated with a . `1Whether a Claim is to acquire or release a room. Get the  target of a . Get the thread attempting a . 7Approve a claim. This actually acquires or releases a . aSet the _ flag. b Acquire and/>or release some rooms for the duration of a critical section.  which s to , and later release, or ? and later reacquire for the duration of the critical section.  a transaction to   all entering s  a transaction to   all exiting s [ a transaction to run one or more times if and only if this thread is waiting for approval  the critical section  A separate C is generated each time a Room needs to be acquired. The critical 3 section will not enter until every claim has been  d. `When the critical section exits, an inverse group of claims will be generated, and the critical 4 section will not exit until those claims have been  d. -It is guaranteed that when and only when all  s have been  !d, the waiting thread will enter 3 (or exit) the critical section. The lock on each  is acquired when it's  is  d, + not when the critical section is entered.  s may be  2d from any transaction, even from another thread. Get all cd#s that are currently claiming this . True iff a Room is empty.  b   b  Rules for calling b. QShould approve a some claims before entering a critical section, as described by b. PShould approve a some claims before exiting a critical section, as described by b. 'A waiting transaction, as described by b.    :Get a notification when a claim is approved or scheduled. BA maximum limit on the number of threads allowed to claim a room. Should either   or e each claim.  - some claims according to their constraints.  Temporarily , and then release, or , and then acquire, some *s for the duration of a critical section. H A simple example where a room might be used to prevent interleaving of stdout:  room <- newRoom (MaxThreads 1) A forkIO $ claim Acquire (Default,room) $ putStrLn "Hello World!" ? forkIO $ claim Acquire (Default,room) $ putStrLn "Foo! Bar!"     Require that all  s be satisfied when acquiring a .    !Don' t check any RoomConstraints when acquiring a . "!"!"!"" #VReprioritize a task. This has no effect on a target that has already left the queue. $%#$%#$%#$%$% -&fghijk'Configuration options for a 1. A 1F blocks on a number of predicates when dispatching a job. Generally, 2  should work well. ' A single STM predicate for the entire 1. This blocks the entire 1# until the predicate is satisfied. Z A STM predicate parameterized by priority. This blocks a single priority level, and the 1' will skip all tasks at that priority. ? Each task is itself an STM transaction, and can block itself. 6 Pure constraints on priority and ordering inversion. iIf a task is blocked for any reason, the task is skipped and the next task attempted, in priority order. ()@A predicate that must hold before any task may be pulled from a 1. *JA predicate that must hold before any priority level may be pulled from a 1. +Constrains the greatest allowed difference between the priority of the top-of-queue task and the priority of a task to be pulled. ,BThe greatest allowed difference between the ideal prioritized FILO/9FIFO ordering of tasks and the actual ordering of tasks. h Setting this too high can introduce a lot of overhead in the presence of a lot of short-running tasks. u Setting this to zero turns off the predicate failover feature, i.e. only the top of queue task will ever be pulled. - Should the 1O run in FILO or FIFO order. Ordering takes place after prioritization, and won'8t have much effect if priorities are very fine-grained. ./01A prioritized 1@. Prioritization is least-first, i.e. larger values are nicer. A 1G is not associated with any working thread, therefore, it is the client'0s responsibility to make sure that every pushed  task is also pulled, or the 19 will stall. There are several ways to accomplish this:  Call =! at least once for every call to :.  Use @ to push every task.  Use A whenever the 1 is not empty. lmnopq2_A queue tuned for high throughput and fairness when processing moderate to long running tasks. 3A queue tuned for high responsiveness and low priority inversion, but may have poorer long-term throughput and potential to starve some tasks compared to 2. r4-True iff this task is poised at the top of it's 1. 56PGet the priority of this task, which only exists if the task is still enqueued. 7Get the 1 associated with this task. 89 Create a new 1. :Put a task with it'As priority value onto this queue. Returns a handle to the task. ;+The number of tasks pending on this Queue. <True iff this Queue is empty. =!Pull and commit a task from this 1. s>!Pull this task from the top of a 1, if it is already there. % If this task is top-of-queue, but it's predicates fail, then ># may instead pull a lower-priority &. tDon't return until the given &% has been pulled from its associated 1.  This doesn't guarantee that the &$ will ever be pulled, even when the & and 1 are both viable. / You must concurrently arrange for every other & associated with the same 1 to be pulled, or the 1 will stall. ?Don't return until the given &)s have been pulled from their associated 1s.  This doesn't guarantee that the &$ will ever be pulled, even when the & and 1 are both viable. / You must concurrently arrange for every other & associated with the same 1 to be pulled, or the 1 will stall.  ? can handle lists &%s that are distributed among several 1s, as well as a & s that have A already completed or complete concurrently from another thread. @"Fire and forget"" some tasks on a separate thread. A Process a 1 until it is empty. uv&'()*+,-./0123456789:;<=>?@A1&.0/'()*+,-23967845:=>?@A;<&'()*+,-()*+,-.0//0123456789:;<=>?@A B*Schedule a task to run from a prioritized 1f. The task will wait until it arrives at (or, with failover, near) the top of queue. Typical usage:   Schedule q 2 room1 Only the rooms inside the CBD declaration are claimed with scheduling. If access to a room doesn'0t need to be prioritized, it can be set outside  the schedule:  (Schedule q 2 room1,room2) CwBCBCBCC xDyz{|EA prioritized  ClaimContext for a task pool. F Create a new D. Ds begin stopped, use J to start.  A (' for the backing 1. A typical value is 2. 3 The allowed number of threads that can access the D simultaneously.  The user data for the backing . This can be (). Consider using G if you have no special needs. GJust create a new DK. The task pool is constrained by the number of capabilities indicated by }. HGet the  that primarily constrains this D. IGet the 1 that admits new tasks to this D. J Start the D. KStop all activity on this D. LTrue iff this D! is entirely empty and inactive. M Wait until a queue is finished. DEFGHIJKLM DEFGHIJKLM DEFGHIJKLM N~OPPerform a task on another thread. This task can be reprioritized and canceled. P$Wait for the result from this task. QNon-blocking version of P. TChange the priority of a task. This will not work if the task has already started. %NOPQON%PQNOPQ RDA convenience class to observe the currently running occupants of a Room or TaskPool. STUVWX$The number of tasks waiting on this TaskPool. YZ* !"#'()*+,-./023DEFGMNORSTUVWXYZ*NOUV#W !"XRST'()*+,-23.0/DEFGYZM RSTSTUVWXYZ !"#$$%&'(()*+,--.. / 0 1 2 3 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F  G H I J K L L M N O P Q R S T  U 2 V W XYWX1FSTZ[\]^_`ab`ab`ac 2 d e f g h < i j k l m n o p q r s t M u v w`ax 2 y z {|priority-sync-0.2.1.1PrioritySync.Internal.UserDataPrioritySync.Internal.Room"PrioritySync.Internal.ClaimContextPrioritySync.Internal.RoomGroupPrioritySync.Internal.Receipt$PrioritySync.Internal.RoomConstraint!PrioritySync.Internal.Constrained#PrioritySync.Internal.Unconstrained!PrioritySync.Internal.PrioritizedPrioritySync.Internal.QueuePrioritySync.Internal.SchedulePrioritySync.Internal.TaskPoolPrioritySync.Internal.DispatchPrioritySync.PrioritySyncPrioritySync.Internal.RoomCoreUserData ClaimModeReleaseAcquireClaimRoomnewRoomuserData claimedRoom claimedThreadapproveinUseisEmpty ClaimContext ClaimHandleapproveClaimsEnteringapproveClaimsExiting waitingAction RoomGrouproomsOfReceiptreceipt_base_contextreceipt_entering_callbackreceipt_exiting_callback MaxThreadsRoomConstraintapproveConstraint approveClaimsclaim Constrained Unconstrained PrioritizedPriority reprioritize TaskHandleQueueConfigurationRecordqueue_predicatepriority_indexed_predicateallowed_priority_inversionallowed_ordering_inversion queue_order QueueOrderFILOFIFOQueuefair_queue_configurationfast_queue_configuration isTopOfQueue hasCompleted taskPriority taskQueue pendingTasksnewQueueputTaskloadpullTask pullFromToppullSpecificTasks dispatchTasks flushQueueScheduleTaskPoolschedule newTaskPoolsimpleTaskPoolpoolRoom poolQueue startQueue stopQueuewaitUntilFinisheddispatch getResult tryGetResult Occupancyroom_user_dataroom_occupants room_is_empty claimMode watchRoomclaim_base GHC.Conc.SyncThreadIdretry task_actionis_top_of_queue has_completedtask_counter_index task_queuequeue_configuration queue_unique pending_tasks task_counterqueue_is_emptytaskOrd pullTask_pullSpecificTask setTopOfQueuewatchingTopOfQueuescheduleClaimsTaskPoolConstraintpool_on pool_queue pool_roomnumCapabilitiestask_reprioritize task_result$fPrioritizedTaskHandle