Comments (7)
The pending PR has a fix for this issue: #178
from dmf.
Resolved by Release v1.1.98. Please use new DMF_ScheduledTask_ExecuteNowDeferredEx() Method. It honors the return value correctly.
from dmf.
Sorry for delayed response.
See resolution below...
from dmf.
Ok, I see what the issue is:
You need to use:
dmfSchedulerCfg.ExecuteWhen = ScheduledTask_ExecuteWhen_PrepareHardware;
or
dmfSchedulerCfg.ExecuteWhen = ScheduledTask_ExecuteWhen_D0Entry;
When you do so you do not use:
DMF_ScheduledTask_ExecuteNowDeferred() or DMF_ScheduledTask_ExecuteNow()
Instead the scheduled task will be automatically started when PrepareHardware or D0Entry happen.
In this case, the scheduled task callback will be called automatically and repeatedly as you expected.
You used:
dmfSchedulerCfg.ExecuteWhen = ScheduledTask_ExecuteWhen_Other;
In this case you also used: DMF_ScheduledTask_ExecuteNowDeferred() or DMF_ScheduledTask_ExecuteNow()
But when you do so using the Method, the automatic retry does not happen (by design).
This is not intuitive and can be considered to be a bug.
At the minimum, the documentation and comments in the code will be updated to reflect this behavior.
But, if possible, we will see if we can update the code so that "Other" mode allows periodic call of Scheduled Task so that it works as one would expect.
Thank you for your feedback.
Please contact [email protected] for faster responses.
from dmf.
Thank you very much for the insights, I will test with ScheduledTask_ExecuteWhen_D0Entry
then, should be alright.
Appreciate the addition to documentation!
One more question though; am I then by design allowed to still call DMF_ScheduledTask_ExecuteNowDeferred()
"in between" when I need to not await the specified timeout value? I'd like to utilize it that way to send a packet to my device ASAP when necessary and sticking to just using the scheduler callback would allow me to not care about synchronization as the only sending code would remain in that callback.
Cheers!
from dmf.
Yes, you instantiate using ScheduledTask_ExecuteWhen_D0Entry
. Then, you can use DMF_ScheduledTask_ExecuteNow()
to cause the same callback to be immediately called. In this case, however, you may need to acquire and release a lock in the callback to make sure that the deferred callback using timer does not race with your immediate execution. In fact, there is a comment in the code that explains that. If I recall, we specifically added DMF_ScheduledTask_ExecuteNow()
for the exact purpose you describe.
Having said all that, I will update the documentation to explain all this (and possibly add a Method to do what you originally intended). I will keep this issue open until the documentation is updated. Let me know if you have any other questions. Thank you for the feedback.
from dmf.
Yes, you instantiate using
ScheduledTask_ExecuteWhen_D0Entry
. Then, you can useDMF_ScheduledTask_ExecuteNow()
to cause the same callback to be immediately called. In this case, however, you may need to acquire and release a lock in the callback to make sure that the deferred callback using timer does not race with your immediate execution. In fact, there is a comment in the code that explains that. If I recall, we specifically addedDMF_ScheduledTask_ExecuteNow()
for the exact purpose you describe.
It works now exactly as I need it with these adjustments, thanks! Also introduced a lock just to be safe.
from dmf.
Related Issues (20)
- Isn't it better to design DMF on C++ code base? HOT 3
- [UMDF] DMF_VirtualHidMini fails WriteReport requests on descriptors without Report IDs HOT 2
- Latest code generates following linker errors in my project HOT 17
- Do not use Visual Studio 16.10.0 or 16.10.1 or 16.10.2 with DMF due to link regressions HOT 4
- Debugging assertion in DMF\Dmf\Modules.Library\Dmf_ScheduledTask.c HOT 12
- Question Regarding SoundWire bus support HOT 11
- Unused config param in DMF_VirtualHidKeyboard module HOT 4
- How can I disable WPP for the DMF driver ? HOT 5
- Duplicated lines HOT 2
- This repo is missing important files
- EyeGazeIoctl sample fails ApiValidator HOT 2
- Pdo_DevicePropertyTableWrite adds properties to parent device instead of PDO HOT 32
- Building with Windows 11, version 22H2 WDK (10.0.22621.0) supported? HOT 9
- Trying to use Dmf_IoctlHandler with Control Device Object, supported? HOT 15
- fatal error C1510: Cannot load language resource clui.dll HOT 12
- WDF Verifier (Handle Tracking) trips over FILEOJECT de-reference without using the right tag HOT 2
- Dmf_VirtualHidKeyboard work in User-mode? HOT 1
- Why are lib files added to linker manually? HOT 5
- Why is `EnableLookAside` a `ULONG` and not a `BOOLEAN`? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dmf.