WM Jobs: Refactor all worker status variables into a single shared struct. #113343

Merged
Bastien Montagne merged 1 commits from mont29/blender:tmp-wmjobs into main 2023-10-09 12:12:30 +02:00

Move the three current 'status variables' (stop, update and progress)
into a single 'WorkerStatus' struct. This is cleaner and will allow for
future workin this area without having to edit tens of 'startjob'
callbacks signatures all the time.

No functional change expected here.

Note: jobs' specific internal code has been modified as little as
possible, in many cases the job's own data still just store pointers to
these three values. Ideally in the future more refactor will be using a
single pointer to the shared wmJobWorkerStatus data instead.


NOTE: This is a first cleanup step before addressing #112537.

Move the three current 'status variables' (stop, update and progress) into a single 'WorkerStatus' struct. This is cleaner and will allow for future workin this area without having to edit tens of 'startjob' callbacks signatures all the time. No functional change expected here. Note: jobs' specific internal code has been modified as little as possible, in many cases the job's own data still just store pointers to these three values. Ideally in the future more refactor will be using a single pointer to the shared `wmJobWorkerStatus` data instead. -------------------- NOTE: This is a first cleanup step before addressing #112537.
Bastien Montagne requested review from Brecht Van Lommel 2023-10-06 13:12:52 +02:00
Bastien Montagne requested review from Campbell Barton 2023-10-06 13:12:52 +02:00
Bastien Montagne requested review from Sergey Sharybin 2023-10-06 13:12:52 +02:00
Brecht Van Lommel approved these changes 2023-10-06 19:49:00 +02:00
Brecht Van Lommel left a comment
Owner

It would be nice to add some comments are better names to clarify that do_update and progress are status reported by the worker, and stop is a signal to the worker that it should stop.

It would be nice to add some comments are better names to clarify that `do_update` and `progress` are status reported by the worker, and `stop` is a signal to the worker that it should stop.
Bastien Montagne force-pushed tmp-wmjobs from 1d387bc669 to 3ff85dbb7b 2023-10-07 16:14:18 +02:00 Compare
Author
Owner

Thanks, added comments for each member, but would rather not rename them for the time being (since the exact same names are also used in many jobs's own data).

Also added some comment regarding thread safety (since this is essentially data shared between threads, without any protection or synchronization to its access).

Thanks, added comments for each member, but would rather not rename them for the time being (since the exact same names are also used in many jobs's own data). Also added some comment regarding thread safety (since this is essentially data shared between threads, without any protection or synchronization to its access).
Sergey Sharybin approved these changes 2023-10-09 09:57:46 +02:00
Bastien Montagne merged commit df0d7c9c3d into main 2023-10-09 12:12:30 +02:00
Bastien Montagne deleted branch tmp-wmjobs 2023-10-09 12:12:32 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#113343
No description provided.