Skip to content

Use single AsyncExecutor for all operations #5096

Answered by tisonkun
BaurzhanSakhariev asked this question in Q&A
Discussion options

You must be logged in to vote

Tested and confirmed that the threads are reused.

Thread-1024 ~ Thread-1035 are OpenDAL threads. The available cores on my laptop are 12.

    @Test
    void testMassiveOperator() throws Exception {
        final CountDownLatch latch = new CountDownLatch(1);
        final CountDownLatch inner = new CountDownLatch(1024);
        final Map<String, String> conf = new HashMap<>();
        conf.put("root", "/opendal/");

//        final int n = 1;
//        try {
//            @Cleanup final AsyncOperator op = AsyncOperator.of("memory", conf);
//            op.write("key-" + n, ("v" + n).getBytes(StandardCharsets.UTF_8)).join();
//            latch.await();
//        } catch (Exception e) {
//…

Replies: 5 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Xuanwo
Comment options

Xuanwo Sep 4, 2024
Collaborator

Comment options

You must be logged in to vote
1 reply
@tisonkun
Comment options

tisonkun Sep 7, 2024
Collaborator

Comment options

You must be logged in to vote
0 replies
Answer selected by BaurzhanSakhariev
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants