Skip to content

Commit 704b4e5

Browse files
committed
Enable async pool and sub-interpreter pool in supervisor
1 parent a119b47 commit 704b4e5

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

src/erlang_python_sup.erl

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ init([]) ->
3939
modules => [py_callback]
4040
},
4141

42+
%% Main worker pool
4243
PoolSpec = #{
4344
id => py_pool,
4445
start => {py_pool, start_link, [NumWorkers]},
@@ -58,13 +59,17 @@ init([]) ->
5859
modules => [py_async_pool]
5960
},
6061

61-
%% Base children (async pool disabled for now - GIL threading issues)
62-
%% TODO: Fix async event loop GIL management
63-
BaseChildren = [CallbackSpec, PoolSpec], %% AsyncPoolSpec temporarily disabled
62+
%% Sub-interpreter pool (for true parallelism with per-interpreter GIL)
63+
SubinterpPoolSpec = #{
64+
id => py_subinterp_pool,
65+
start => {py_subinterp_pool, start_link, [NumSubinterpWorkers]},
66+
restart => permanent,
67+
shutdown => 5000,
68+
type => worker,
69+
modules => [py_subinterp_pool]
70+
},
6471

65-
%% Sub-interpreter pool also temporarily disabled for testing
66-
%% TODO: Fix sub-interpreter GIL management
67-
Children = BaseChildren,
72+
Children = [CallbackSpec, PoolSpec, AsyncPoolSpec, SubinterpPoolSpec],
6873

6974
{ok, {
7075
#{strategy => one_for_all, intensity => 5, period => 10},

0 commit comments

Comments
 (0)