ByteCode.News
Submit RSS Atom Sign in

Back to the channels

#java

  1. * johnjay joined #java
  2. * metalmaniac joined #java
  3. * jonp` joined #java
  4. * firewyre joined #java
  5. * internecine joined #java
  6. internecine Who uses GitHub copilot at work and is limited by tokens. How many tokens are you allotted
  7. * LtHummus_ joined #java
  8. * rorx joined #java
  9. * OmniRadix6989 joined #java
  10. * julemand101 joined #java
  11. * ChaiTRex joined #java
  12. * woodenAllen joined #java
  13. * woodenAllen joined #java
  14. * ChaiTRex joined #java
  15. * woodenAllen joined #java
  16. * iwtga joined #java
  17. * MikeBux joined #java
  18. * hugdru joined #java
  19. * PocketKiller joined #java
  20. * Afroboy joined #java
  21. * woodenAllen joined #java
  22. * woodenAllen joined #java
  23. * lord4163 joined #java
  24. * handicraftsman joined #java
  25. * five618480339176 joined #java
  26. * hugdru joined #java
  27. * woodenAllen joined #java
  28. * woodenAllen joined #java
  29. * pebble joined #java
  30. * GreenResponse joined #java
  31. * hugdru joined #java
  32. * acidjnk joined #java
  33. * kathadris joined #java
  34. * hwpplayer1 joined #java
  35. * hugdru joined #java
  36. * Chai-T-Rex joined #java
  37. * ChaiTRex joined #java
  38. * soulofset joined #java
  39. * hwpplayer1 joined #java
  40. * enoq joined #java
  41. enoq when creating a completablefuture inside a virtual thread, does the future suspend on the VT like any other I/O operation?
  42. enoq or does awaiting the future block the carrier thread that launched the VT
  43. enoq at least to me it looks like I need to provide an executor like this var executor = Executors.newVirtualThreadPerTaskExecutor();
  44. * gas51627 joined #java
  45. nimaje isn't a future just a container to write the result into, without any information how the result will be computed? so what happens should depend on whatever gives you that future, in the worst case it just crates it and never calls .complete(…) on it
  46. enoq my understanding is that the future forks off a new thread and then .get() blocks the thread it is on
  47. enoq what I don't know is if the default thread type is changed when running inside a VT and if .get() inside a VT suspend
  48. enoq +s
  49. nimaje that sounds more like FutureTask, how should the Future know what it should do? And where did you get that idea that it would spawn a thread? Especially as CompletableFuture has "this class has no direct control over the computation" in its docs
  50. deebo there's CompletableFuture.supplyAsync(task, executor)
  51. nimaje yeah, that is one way to create a CompletableFuture that excactly tells you how the result will be computed, even if I don't understand why that gives you a CompletableFuture instead of just a Future, are there really use cases where you want to submit some work, but have the possibility to complete it yourself some other way?
  52. Para relevant https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/concurrent/CompletionStage.html
  53. nevet CompletionStage (Java SE 21 & JDK 21)
  54. * domicron joined #java
  55. * iwtga joined #java
  56. * domicron6 joined #java
  57. * WizJin joined #java
  58. * jreicher joined #java
  59. * rvalue joined #java
  60. * hwpplayer1 joined #java
  61. enoq maybe another way to frame this: is there a list of java APIs that suspend on virtual threads
  62. * rvalue- joined #java
  63. * benjwadams joined #java
  64. * rvalue left #java
  65. * metalmaniac joined #java
  66. * jamezp joined #java
  67. cheeser i'm not aware that libraries need to do anything for virtual threads.
  68. * woodenAllen joined #java
  69. * hugdru joined #java
  70. * woodenAllen joined #java
  71. * hwpplayer1 joined #java
  72. * MikeBux joined #java
  73. * hwpplayer1 joined #java
  74. * woodenAllen joined #java
  75. * domicron6 joined #java
  76. * hugdru joined #java
  77. * kusanagi joined #java
  78. * bdkl joined #java
  79. * woodenAllen joined #java
  80. * WizJin joined #java
  81. * m joined #java
  82. * OmniRadix6989 joined #java
  83. * OmniRadix69891 joined #java
  84. * magla joined #java
  85. * fstd joined #java
  86. * five618480339176 joined #java
  87. * Cae2 joined #java
  88. * lockdown joined #java
  89. * tomboy64 joined #java
  90. * cmiles74 joined #java
  91. * hwpplayer1 joined #java
  92. * hugdru joined #java
  93. * jjakob_ joined #java
  94. * ForeverDreaming joined #java
  95. * ForeverDreaming joined #java
  96. * jjakob joined #java