Skip to content

Conversation

@bryghtlabs-richard
Copy link
Contributor

@bryghtlabs-richard bryghtlabs-richard commented Dec 1, 2025

Description

Add CPU core affinity to websocket thread configuration. Otherwise simple parsing code like cJSON may pin it unexpectedly.

Testing

This was tested by printing the affinity on event receipt. We could add a test to run a WS client on each core if desired, as well as unpinned.

Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

Note

Adds configurable CPU core affinity for the websocket client task and pins it using xTaskCreatePinnedToCore.

  • WebSocket client:
    • API: Extend esp_websocket_client_config_t with task_core_id_set and task_core_id to allow specifying CPU affinity.
    • Defaults: Add WEBSOCKET_TASK_CORE_ID default (tskNO_AFFINITY).
    • Config handling: Store task_core_id in internal websocket_config_storage_t; set from config or default.
    • Task startup: Replace xTaskCreate with xTaskCreatePinnedToCore(..., client->config->task_core_id) to pin client task to the chosen core.

Written by Cursor Bugbot for commit 21f4c53. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant