Skip to content
This repository was archived by the owner on Aug 26, 2022. It is now read-only.

Commit da2a777

Browse files
authored
Updates to operation group id and hardening of scheduler against handler task changes (#434)
1 parent a093861 commit da2a777

37 files changed

+953
-675
lines changed

Common/version.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- This file may be overwritten by automation. Only values allowed here are VersionPrefix and VersionSuffix. -->
22
<Project>
33
<PropertyGroup>
4-
<VersionPrefix>1.6.1</VersionPrefix>
4+
<VersionPrefix>1.6.2</VersionPrefix>
55
<VersionSuffix></VersionSuffix>
66
</PropertyGroup>
77
</Project>

Samples/Framework/build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
<OutputPath>..\bin\</OutputPath>
1313
</PropertyGroup>
1414
<ItemGroup>
15-
<PackageReference Include="Microsoft.PSharp" Version="1.6.1" />
15+
<PackageReference Include="Microsoft.PSharp" Version="1.6.2" />
1616
</ItemGroup>
1717
</Project>

Samples/Language/build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
<OutputPath>..\bin\</OutputPath>
1111
</PropertyGroup>
1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.PSharp" Version="1.6.1" />
13+
<PackageReference Include="Microsoft.PSharp" Version="1.6.2" />
1414
</ItemGroup>
1515
</Project>

Scripts/NuGet/PSharp.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
<package >
33
<metadata>
44
<id>Microsoft.PSharp</id>
5-
<version>1.6.1</version>
5+
<version>1.6.2</version>
66
<authors>Microsoft</authors>
77
<projectUrl>https://github.com/p-org/PSharp</projectUrl>
88
<license type="expression">MIT</license>
99
<requireLicenseAcceptance>false</requireLicenseAcceptance>
1010
<description>P# is a framework for rapid development of reliable asynchronous software.</description>
11-
<releaseNotes>This release contains the 1.6.1 version of the P# framework.</releaseNotes>
11+
<releaseNotes>This release contains the 1.6.2 version of the P# framework.</releaseNotes>
1212
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
1313
<tags>asynchrony reliability specifications reactive state-machines testing</tags>
1414
</metadata>

Source/Core/IMachineRuntime.cs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ public interface IMachineRuntime : IDisposable
6060
/// </summary>
6161
/// <param name="type">Type of the machine.</param>
6262
/// <param name="e">Optional event used during initialization.</param>
63-
/// <param name="operationGroupId">Optional operation group id.</param>
63+
/// <param name="opGroupId">Optional id that can be used to identify this operation.</param>
6464
/// <returns>The result is the machine id.</returns>
65-
MachineId CreateMachine(Type type, Event e = null, Guid operationGroupId = default);
65+
MachineId CreateMachine(Type type, Event e = null, Guid opGroupId = default);
6666

6767
/// <summary>
6868
/// Creates a new machine of the specified <see cref="Type"/> and name, and
@@ -72,9 +72,9 @@ public interface IMachineRuntime : IDisposable
7272
/// <param name="type">Type of the machine.</param>
7373
/// <param name="machineName">Optional machine name used for logging.</param>
7474
/// <param name="e">Optional event used during initialization.</param>
75-
/// <param name="operationGroupId">Optional operation group id.</param>
75+
/// <param name="opGroupId">Optional id that can be used to identify this operation.</param>
7676
/// <returns>The result is the machine id.</returns>
77-
MachineId CreateMachine(Type type, string machineName, Event e = null, Guid operationGroupId = default);
77+
MachineId CreateMachine(Type type, string machineName, Event e = null, Guid opGroupId = default);
7878

7979
/// <summary>
8080
/// Creates a new machine of the specified type, using the specified <see cref="MachineId"/>.
@@ -84,9 +84,9 @@ public interface IMachineRuntime : IDisposable
8484
/// <param name="mid">Unbound machine id.</param>
8585
/// <param name="type">Type of the machine.</param>
8686
/// <param name="e">Optional event used during initialization.</param>
87-
/// <param name="operationGroupId">Optional operation group id.</param>
87+
/// <param name="opGroupId">Optional id that can be used to identify this operation.</param>
8888
/// <returns>The result is the machine id.</returns>
89-
MachineId CreateMachine(MachineId mid, Type type, Event e = null, Guid operationGroupId = default);
89+
MachineId CreateMachine(MachineId mid, Type type, Event e = null, Guid opGroupId = default);
9090

9191
/// <summary>
9292
/// Creates a new machine of the specified <see cref="Type"/> and with the
@@ -96,9 +96,9 @@ public interface IMachineRuntime : IDisposable
9696
/// </summary>
9797
/// <param name="type">Type of the machine.</param>
9898
/// <param name="e">Optional event used during initialization.</param>
99-
/// <param name="operationGroupId">Optional operation group id.</param>
99+
/// <param name="opGroupId">Optional id that can be used to identify this operation.</param>
100100
/// <returns>Task that represents the asynchronous operation. The task result is the machine id.</returns>
101-
Task<MachineId> CreateMachineAndExecuteAsync(Type type, Event e = null, Guid operationGroupId = default);
101+
Task<MachineId> CreateMachineAndExecuteAsync(Type type, Event e = null, Guid opGroupId = default);
102102

103103
/// <summary>
104104
/// Creates a new machine of the specified <see cref="Type"/> and name, and with
@@ -109,9 +109,9 @@ public interface IMachineRuntime : IDisposable
109109
/// <param name="type">Type of the machine.</param>
110110
/// <param name="machineName">Optional machine name used for logging.</param>
111111
/// <param name="e">Optional event used during initialization.</param>
112-
/// <param name="operationGroupId">Optional operation group id.</param>
112+
/// <param name="opGroupId">Optional id that can be used to identify this operation.</param>
113113
/// <returns>Task that represents the asynchronous operation. The task result is the machine id.</returns>
114-
Task<MachineId> CreateMachineAndExecuteAsync(Type type, string machineName, Event e = null, Guid operationGroupId = default);
114+
Task<MachineId> CreateMachineAndExecuteAsync(Type type, string machineName, Event e = null, Guid opGroupId = default);
115115

116116
/// <summary>
117117
/// Creates a new machine of the specified <see cref="Type"/>, using the specified
@@ -123,9 +123,9 @@ public interface IMachineRuntime : IDisposable
123123
/// <param name="mid">Unbound machine id.</param>
124124
/// <param name="type">Type of the machine.</param>
125125
/// <param name="e">Optional event used during initialization.</param>
126-
/// <param name="operationGroupId">Optional operation group id.</param>
126+
/// <param name="opGroupId">Optional id that can be used to identify this operation.</param>
127127
/// <returns>Task that represents the asynchronous operation. The task result is the machine id.</returns>
128-
Task<MachineId> CreateMachineAndExecuteAsync(MachineId mid, Type type, Event e = null, Guid operationGroupId = default);
128+
Task<MachineId> CreateMachineAndExecuteAsync(MachineId mid, Type type, Event e = null, Guid opGroupId = default);
129129

130130
/// <summary>
131131
/// Creates a new machine of the specified <see cref="Type"/> and with the
@@ -135,10 +135,10 @@ public interface IMachineRuntime : IDisposable
135135
/// </summary>
136136
/// <param name="type">Type of the machine.</param>
137137
/// <param name="e">Optional event used during initialization.</param>
138-
/// <param name="operationGroupId">Optional operation group id.</param>
138+
/// <param name="opGroupId">Optional id that can be used to identify this operation.</param>
139139
/// <returns>Task that represents the asynchronous operation. The task result is the machine id.</returns>
140140
[Obsolete("Please use IMachineRuntime.CreateMachineAndExecuteAsync(...) instead.")]
141-
Task<MachineId> CreateMachineAndExecute(Type type, Event e = null, Guid operationGroupId = default);
141+
Task<MachineId> CreateMachineAndExecute(Type type, Event e = null, Guid opGroupId = default);
142142

143143
/// <summary>
144144
/// Creates a new machine of the specified <see cref="Type"/> and name, and with
@@ -149,10 +149,10 @@ public interface IMachineRuntime : IDisposable
149149
/// <param name="type">Type of the machine.</param>
150150
/// <param name="machineName">Optional machine name used for logging.</param>
151151
/// <param name="e">Optional event used during initialization.</param>
152-
/// <param name="operationGroupId">Optional operation group id.</param>
152+
/// <param name="opGroupId">Optional id that can be used to identify this operation.</param>
153153
/// <returns>Task that represents the asynchronous operation. The task result is the machine id.</returns>
154154
[Obsolete("Please use IMachineRuntime.CreateMachineAndExecuteAsync(...) instead.")]
155-
Task<MachineId> CreateMachineAndExecute(Type type, string machineName, Event e = null, Guid operationGroupId = default);
155+
Task<MachineId> CreateMachineAndExecute(Type type, string machineName, Event e = null, Guid opGroupId = default);
156156

157157
/// <summary>
158158
/// Creates a new machine of the specified <see cref="Type"/>, using the specified
@@ -164,44 +164,44 @@ public interface IMachineRuntime : IDisposable
164164
/// <param name="mid">Unbound machine id.</param>
165165
/// <param name="type">Type of the machine.</param>
166166
/// <param name="e">Optional event used during initialization.</param>
167-
/// <param name="operationGroupId">Optional operation group id.</param>
167+
/// <param name="opGroupId">Optional id that can be used to identify this operation.</param>
168168
/// <returns>Task that represents the asynchronous operation. The task result is the machine id.</returns>
169169
[Obsolete("Please use IMachineRuntime.CreateMachineAndExecuteAsync(...) instead.")]
170-
Task<MachineId> CreateMachineAndExecute(MachineId mid, Type type, Event e = null, Guid operationGroupId = default);
170+
Task<MachineId> CreateMachineAndExecute(MachineId mid, Type type, Event e = null, Guid opGroupId = default);
171171

172172
/// <summary>
173173
/// Sends an asynchronous <see cref="Event"/> to a machine.
174174
/// </summary>
175175
/// <param name="target">The id of the target machine.</param>
176176
/// <param name="e">The event to send.</param>
177-
/// <param name="operationGroupId">Optional operation group id.</param>
177+
/// <param name="opGroupId">Optional id that can be used to identify this operation.</param>
178178
/// <param name="options">Optional configuration of a send operation.</param>
179-
void SendEvent(MachineId target, Event e, Guid operationGroupId = default, SendOptions options = null);
179+
void SendEvent(MachineId target, Event e, Guid opGroupId = default, SendOptions options = null);
180180

181181
/// <summary>
182182
/// Sends an <see cref="Event"/> to a machine. Returns immediately if the target machine was already
183183
/// running. Otherwise blocks until the machine handles the event and reaches quiescense.
184184
/// </summary>
185185
/// <param name="target">The id of the target machine.</param>
186186
/// <param name="e">The event to send.</param>
187-
/// <param name="operationGroupId">Optional operation group id.</param>
187+
/// <param name="opGroupId">Optional id that can be used to identify this operation.</param>
188188
/// <param name="options">Optional configuration of a send operation.</param>
189189
/// <returns>Task that represents the asynchronous operation. The task result is true if
190190
/// the event was handled, false if the event was only enqueued.</returns>
191-
Task<bool> SendEventAndExecuteAsync(MachineId target, Event e, Guid operationGroupId = default, SendOptions options = null);
191+
Task<bool> SendEventAndExecuteAsync(MachineId target, Event e, Guid opGroupId = default, SendOptions options = null);
192192

193193
/// <summary>
194194
/// Sends an <see cref="Event"/> to a machine. Returns immediately if the target machine was already
195195
/// running. Otherwise blocks until the machine handles the event and reaches quiescense.
196196
/// </summary>
197197
/// <param name="target">The id of the target machine.</param>
198198
/// <param name="e">The event to send.</param>
199-
/// <param name="operationGroupId">Optional operation group id.</param>
199+
/// <param name="opGroupId">Optional id that can be used to identify this operation.</param>
200200
/// <param name="options">Optional configuration of a send operation.</param>
201201
/// <returns>Task that represents the asynchronous operation. The task result is true if
202202
/// the event was handled, false if the event was only enqueued.</returns>
203203
[Obsolete("Please use IMachineRuntime.SendEventAndExecuteAsync(...) instead.")]
204-
Task<bool> SendEventAndExecute(MachineId target, Event e, Guid operationGroupId = default, SendOptions options = null);
204+
Task<bool> SendEventAndExecute(MachineId target, Event e, Guid opGroupId = default, SendOptions options = null);
205205

206206
/// <summary>
207207
/// Registers a new specification monitor of the specified <see cref="Type"/>.

Source/Core/IO/Logging/DisposingLogger.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,10 @@ public void OnWait(MachineId machineId, string currStateName, params Type[] even
207207
/// <param name="senderId">The machine that sent the event, if any.</param>
208208
/// <param name="senderStateName">The name of the current state of the sender machine, if any.</param>
209209
/// <param name="eventName">The event being sent.</param>
210-
/// <param name="operationGroupId">The operation group id.</param>
210+
/// <param name="opGroupId">Id used to identify the send operation.</param>
211211
/// <param name="isTargetHalted">Is the target machine halted.</param>
212212
public void OnSend(MachineId targetMachineId, MachineId senderId, string senderStateName, string eventName,
213-
Guid operationGroupId, bool isTargetHalted)
213+
Guid opGroupId, bool isTargetHalted)
214214
{
215215
}
216216

Source/Core/IO/Logging/ILogger.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,10 @@ public interface ILogger : IDisposable
163163
/// <param name="senderId">The id of the machine that sent the event, if any.</param>
164164
/// <param name="senderStateName">The name of the current state of the sender machine, if any.</param>
165165
/// <param name="eventName">The event being sent.</param>
166-
/// <param name="operationGroupId">The operation group id.</param>
166+
/// <param name="opGroupId">Id used to identify the send operation.</param>
167167
/// <param name="isTargetHalted">Is the target machine halted.</param>
168168
void OnSend(MachineId targetMachineId, MachineId senderId, string senderStateName, string eventName,
169-
Guid operationGroupId, bool isTargetHalted);
169+
Guid opGroupId, bool isTargetHalted);
170170

171171
/// <summary>
172172
/// Called when a machine has been created.

Source/Core/IO/Logging/MachineLogger.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -379,14 +379,14 @@ public virtual string FormatOnWaitString(MachineId machineId, string currStateNa
379379
/// <param name="senderId">The id of the machine that sent the event, if any.</param>
380380
/// <param name="senderStateName">The name of the current state of the sender machine, if any.</param>
381381
/// <param name="eventName">The event being sent.</param>
382-
/// <param name="operationGroupId">The operation group id.</param>
382+
/// <param name="opGroupId">Id used to identify the send operation.</param>
383383
/// <param name="isTargetHalted">Is the target machine halted.</param>
384384
public virtual void OnSend(MachineId targetMachineId, MachineId senderId, string senderStateName, string eventName,
385-
Guid operationGroupId, bool isTargetHalted)
385+
Guid opGroupId, bool isTargetHalted)
386386
{
387387
if (this.IsVerbose)
388388
{
389-
this.WriteLine(this.FormatOnSendString(targetMachineId, senderId, senderStateName, eventName, operationGroupId, isTargetHalted));
389+
this.WriteLine(this.FormatOnSendString(targetMachineId, senderId, senderStateName, eventName, opGroupId, isTargetHalted));
390390
}
391391
}
392392

@@ -397,15 +397,15 @@ public virtual void OnSend(MachineId targetMachineId, MachineId senderId, string
397397
/// <param name="senderId">The id of the machine that sent the event, if any.</param>
398398
/// <param name="senderStateName">The name of the current state of the sender machine, if any.</param>
399399
/// <param name="eventName">The event being sent.</param>
400-
/// <param name="operationGroupId">The operation group id.</param>
400+
/// <param name="opGroupId">Id used to identify the send operation.</param>
401401
/// <param name="isTargetHalted">Is the target machine halted.</param>
402-
public virtual string FormatOnSendString(MachineId targetMachineId, MachineId senderId, string senderStateName, string eventName,
403-
Guid operationGroupId, bool isTargetHalted)
402+
public virtual string FormatOnSendString(MachineId targetMachineId, MachineId senderId, string senderStateName,
403+
string eventName, Guid opGroupId, bool isTargetHalted)
404404
{
405-
var operationGroupIdMsg = operationGroupId != Guid.Empty ? $" (operation group '{operationGroupId}')" : string.Empty;
405+
var opGroupIdMsg = opGroupId != Guid.Empty ? $" (operation group '{opGroupId}')" : string.Empty;
406406
var target = isTargetHalted ? $"halted machine '{targetMachineId}'" : $"machine '{targetMachineId}'";
407407
var sender = senderId != null ? $"Machine '{senderId}' in state '{senderStateName}'" : $"The runtime";
408-
return $"<SendLog> {sender} sent event '{eventName}' to {target}{operationGroupIdMsg}.";
408+
return $"<SendLog> {sender} sent event '{eventName}' to {target}{opGroupIdMsg}.";
409409
}
410410

411411
/// <summary>

0 commit comments

Comments
 (0)