Skip to content

Conversation

@alvintho
Copy link

@alvintho alvintho commented Apr 11, 2025

Related issue:
#11 (comment)

Cross-platform encoding compatibility fix

Problem

The current encoding implementation using multiprocessing.Pool fails on macOS due to its different process forking behavior. This affects users trying to run the encoding function on macOS systems.

Solution

Implemented OS-specific parallel processing:

  • Uses ThreadPoolExecutor for macOS environments
  • Retains multiprocessing.Pool for other operating systems (Linux/Windows)

Technical Details

  • macOS handles process forking differently ("copy-on-write"), causing issues with multiprocessing.Pool
  • ThreadPoolExecutor provides a more reliable parallel processing solution for macOS
  • Added OS detection using platform.system() to automatically choose the appropriate method

Result after fix:
image

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