bighugemassive3
bighugemassive3
CC#
Created by bighugemassive3 on 12/28/2024 in #help
return Object<byte> after checking typeof(T) == typeof(byte)
Though not sure if it works at runtime, i have way too many errors at the moment
13 replies
CC#
Created by bighugemassive3 on 12/28/2024 in #help
return Object<byte> after checking typeof(T) == typeof(byte)
where TValue : IParsable<TValue> seems to work though
13 replies
CC#
Created by bighugemassive3 on 12/28/2024 in #help
return Object<byte> after checking typeof(T) == typeof(byte)
Just parsable really
13 replies
CC#
Created by bighugemassive3 on 12/28/2024 in #help
return Object<byte> after checking typeof(T) == typeof(byte)
I'm wondering if constrainting TValue to INumberBase<TValue> would work
13 replies
CC#
Created by bighugemassive3 on 12/28/2024 in #help
return Object<byte> after checking typeof(T) == typeof(byte)
It's for a serialisable property
13 replies
CC#
Created by bighugemassive3 on 12/28/2024 in #help
return Object<byte> after checking typeof(T) == typeof(byte)
That what I think i'll do, just use object instead of TValue
13 replies
CC#
Created by bighugemassive3 on 12/28/2024 in #help
return Object<byte> after checking typeof(T) == typeof(byte)
The constructor takes Func<string, TValue> fromString
13 replies
CC#
Created by bighugemassive3 on 12/28/2024 in #help
return Object<byte> after checking typeof(T) == typeof(byte)
Yeah
13 replies
CC#
Created by bighugemassive3 on 12/12/2024 in #help
Race condition with Interlocked.Exchange
Appreciate the help fred 👍
39 replies
CC#
Created by bighugemassive3 on 12/12/2024 in #help
Race condition with Interlocked.Exchange
Clear the critical state in case InvokeAsync is called within microseconds
39 replies
CC#
Created by bighugemassive3 on 12/12/2024 in #help
Race condition with Interlocked.Exchange
I'm thinking this might do the trick
ObjectWrapper? value;
lock (this.stateLock)
{
value = Interlocked.Exchange(ref this.currentValue, null);
this.ClearCriticalState();
}
ObjectWrapper? value;
lock (this.stateLock)
{
value = Interlocked.Exchange(ref this.currentValue, null);
this.ClearCriticalState();
}
39 replies
CC#
Created by bighugemassive3 on 12/12/2024 in #help
Race condition with Interlocked.Exchange
I guess InvokeAsync updated the value after the first ExecuteCore, and then that cleared the value. But because InvokeAsync was called during the first ExecuteCore, the critical state got set so ExecuteCore was called again
39 replies
CC#
Created by bighugemassive3 on 12/12/2024 in #help
Race condition with Interlocked.Exchange
Looks like InvokeAsync was called in the same 10~ microsecond window as ExecuteCore
39 replies
CC#
Created by bighugemassive3 on 12/12/2024 in #help
Race condition with Interlocked.Exchange
InvokeAsync called 3 times sequentially, ExecuteCore called twice sequentially
39 replies
CC#
Created by bighugemassive3 on 12/12/2024 in #help
Race condition with Interlocked.Exchange
Nevermind, just hit it and i actually did get that case you spoke about
8730397 | 19867.92867 ExecuteCore with FramePFX.Utils.RDA.RateLimitedDispatchAction`1+ObjectWrapper[FramePFX.Editing.UI.ITimelineElement]
8730397 | 19868.05789 InvokeAsync
8730397 | 19868.05834 ExecuteCore with FramePFX.Utils.RDA.RateLimitedDispatchAction`1+ObjectWrapper[FramePFX.Editing.UI.ITimelineElement]
8730397 | 19868.05949 InvokeAsync
8730397 | 19868.19200 InvokeAsync
8730397 | 19868.19279 InvokeAsync
8730397 | 19868.19279 ExecuteCore with FramePFX.Utils.RDA.RateLimitedDispatchAction`1+ObjectWrapper[FramePFX.Editing.UI.ITimelineElement]
8730397 | 19868.31126 ExecuteCore with
8730397 | 19867.92867 ExecuteCore with FramePFX.Utils.RDA.RateLimitedDispatchAction`1+ObjectWrapper[FramePFX.Editing.UI.ITimelineElement]
8730397 | 19868.05789 InvokeAsync
8730397 | 19868.05834 ExecuteCore with FramePFX.Utils.RDA.RateLimitedDispatchAction`1+ObjectWrapper[FramePFX.Editing.UI.ITimelineElement]
8730397 | 19868.05949 InvokeAsync
8730397 | 19868.19200 InvokeAsync
8730397 | 19868.19279 InvokeAsync
8730397 | 19868.19279 ExecuteCore with FramePFX.Utils.RDA.RateLimitedDispatchAction`1+ObjectWrapper[FramePFX.Editing.UI.ITimelineElement]
8730397 | 19868.31126 ExecuteCore with
39 replies
CC#
Created by bighugemassive3 on 12/12/2024 in #help
Race condition with Interlocked.Exchange
Annoyingly I can't hit the break point with some Debug.WriteLine code added
39 replies
CC#
Created by bighugemassive3 on 12/12/2024 in #help
Race condition with Interlocked.Exchange
Which is why I introduced the critical continue state, which tells the task to keep running since InvokeAsync was invoked very closely around ExecuteCore
39 replies
CC#
Created by bighugemassive3 on 12/12/2024 in #help
Race condition with Interlocked.Exchange
InvokeAsync could get called just before or just after ExecuteCore is invoked, and even just before and just after it completes
39 replies
CC#
Created by bighugemassive3 on 12/12/2024 in #help
Race condition with Interlocked.Exchange
It's why I added the lock so that I could at least get a slice of time to sync everything
39 replies
CC#
Created by bighugemassive3 on 12/12/2024 in #help
Race condition with Interlocked.Exchange
InvokeAsync could get called at any time so not really
39 replies