kou commented on code in PR #48462:
URL: https://github.com/apache/arrow/pull/48462#discussion_r2616836812


##########
c_glib/arrow-glib/compute.cpp:
##########
@@ -327,15 +313,23 @@ 
garrow_execute_context_class_init(GArrowExecuteContextClass *klass)
 
 /**
  * garrow_execute_context_new:
+ * @thread_pool: (nullable): A #GArrowThreadPool or %NULL.
  *
  * Returns: A newly created #GArrowExecuteContext.
  *
  * Since: 1.0.0
  */
 GArrowExecuteContext *
-garrow_execute_context_new(void)
+garrow_execute_context_new(GArrowThreadPool *thread_pool)
 {
   auto execute_context = g_object_new(GARROW_TYPE_EXECUTE_CONTEXT, NULL);
+  auto priv = GARROW_EXECUTE_CONTEXT_GET_PRIVATE(execute_context);
+
+  auto arrow_thread_pool = garrow_thread_pool_get_raw(thread_pool);
+  priv->thread_pool = arrow_thread_pool;

Review Comment:
   If we want to avoid needless `arrow::compute::ExecContext` construction, we 
need to change
   
   ```cpp
   typedef struct GArrowExecuteContextPrivate_
   {
     arrow::compute::ExecContext context;
   } GArrowExecuteContextPrivate;
   ```
   
   to
   
   ```cpp
   typedef struct GArrowExecuteContextPrivate_
   {
     std::shared_ptr<arrow::compute::ExecContext> context;
   } GArrowExecuteContextPrivate;
   ```
   
   and call `std::make_shared<arrow::compute::ExecContext>(...)` in 
`garrow_execute_context_set_property(PROP_THREAD_POOL)`.
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to