gdb on Linux w. spawn'ed threads?

2024-03-18 Thread Andy Valencia via Digitalmars-d-debugger
address for the breakpoint. Has anybody else noticed a problem with breakpoints for worker threads? Or should I be looking at something else? (Note, I can break at _Dmain and see things OK, it's just once the middleware has taken over that I can't seem to look at the running code.)

[Issue 24260] New: GC creates too many threads when running with restricted CPU affinity

2023-11-24 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24260 Issue ID: 24260 Summary: GC creates too many threads when running with restricted CPU affinity Product: D Version: D2 Hardware: All OS: All Status

Re: parallel threads stalls until all thread batches are finished.

2023-08-29 Thread Joe--- via Digitalmars-d-learn
On Monday, 28 August 2023 at 22:43:56 UTC, Ali Çehreli wrote: On 8/28/23 15:37, j...@bloow.edu wrote: > Basically everything is hard coded to use totalCPU's parallel() is a function that dispatches to a default TaskPool object, which uses totalCPUs. It's convenient but as you say, not all

Re: parallel threads stalls until all thread batches are finished.

2023-08-29 Thread Christian Köstlin via Digitalmars-d-learn
On 29.08.23 00:37, j...@bloow.edu wrote: Well, I have 32 cores so that would spawn 64-1 threads with hyper threading so not really a solution as it is too many simultaneous downs IMO. "These properties get and set the number of worker threads in the TaskPool instance returned by tas

Re: parallel threads stalls until all thread batches are finished.

2023-08-28 Thread Ali Çehreli via Digitalmars-d-learn
On 8/28/23 15:37, j...@bloow.edu wrote: > Basically everything is hard coded to use totalCPU's parallel() is a function that dispatches to a default TaskPool object, which uses totalCPUs. It's convenient but as you say, not all problems should use it. In such cases, you would create your

Re: parallel threads stalls until all thread batches are finished.

2023-08-28 Thread Joe--- via Digitalmars-d-learn
ll workloads where task / thread switching would be a big performance problem (I guess). So in your case a work unit size of 1 should be good. Did you try this already? Kind regards, Christian Well, I have 32 cores so that would spawn 64-1 threads with hyper threading so not r

Re: parallel threads stalls until all thread batches are finished.

2023-08-28 Thread Christian Köstlin via Digitalmars-d-learn
On 26.08.23 05:39, j...@bloow.edu wrote: On Friday, 25 August 2023 at 21:31:37 UTC, Ali Çehreli wrote: On 8/25/23 14:27, j...@bloow.edu wrote: > "A work unit is a set of consecutive elements of range to be processed > by a worker thread between communication with any other thread. The > number

Re: parallel threads stalls until all thread batches are finished.

2023-08-25 Thread Joe--- via Digitalmars-d-learn
). Ultimately this seems like a design flaw in ThreadPool which should auto rebalance the threads and not treat the number of threads as identical to the worker unit size(well, length/workerunitsize). e.g., suppose we have 1000 tasks and set worker unit size to 100. This gives 10 workers and 10

Re: parallel threads stalls until all thread batches are finished.

2023-08-25 Thread Joe--- via Digitalmars-d-learn
On Friday, 25 August 2023 at 21:31:37 UTC, Ali Çehreli wrote: On 8/25/23 14:27, j...@bloow.edu wrote: > "A work unit is a set of consecutive elements of range to be processed > by a worker thread between communication with any other thread. The > number of elements processed per work unit is

Re: parallel threads stalls until all thread batches are finished.

2023-08-25 Thread Adam D Ruppe via Digitalmars-d-learn
On Wednesday, 23 August 2023 at 13:03:36 UTC, Joe wrote: to download files from the internet. Are they particularly big files? You might consider using one of the other libs that does it all in one thread. (i ask about size cuz mine ive never tested doing big files at once, i usually use it

Re: parallel threads stalls until all thread batches are finished.

2023-08-25 Thread Ali Çehreli via Digitalmars-d-learn
On 8/25/23 14:27, j...@bloow.edu wrote: > "A work unit is a set of consecutive elements of range to be processed > by a worker thread between communication with any other thread. The > number of elements processed per work unit is controlled by the > workUnitSize parameter. " > > So the question

Re: parallel threads stalls until all thread batches are finished.

2023-08-25 Thread Joe--- via Digitalmars-d-learn
On Wednesday, 23 August 2023 at 14:43:33 UTC, Sergey wrote: On Wednesday, 23 August 2023 at 13:03:36 UTC, Joe wrote: I use foreach(s; taskPool.parallel(files, numParallel)) { L(s); } // L(s) represents the work to be done. If you make for example that L function return “ok” in case file

Re: parallel threads stalls until all thread batches are finished.

2023-08-25 Thread Joe--- via Digitalmars-d-learn
On Wednesday, 23 August 2023 at 14:43:33 UTC, Sergey wrote: On Wednesday, 23 August 2023 at 13:03:36 UTC, Joe wrote: I use foreach(s; taskPool.parallel(files, numParallel)) { L(s); } // L(s) represents the work to be done. If you make for example that L function return “ok” in case file

Re: parallel threads stalls until all thread batches are finished.

2023-08-23 Thread Sergey via Digitalmars-d-learn
On Wednesday, 23 August 2023 at 13:03:36 UTC, Joe wrote: I use foreach(s; taskPool.parallel(files, numParallel)) { L(s); } // L(s) represents the work to be done. If you make for example that L function return “ok” in case file successfully downloaded, you can try to use TaskPool.amap. The

parallel threads stalls until all thread batches are finished.

2023-08-23 Thread Joe--- via Digitalmars-d-learn
I use foreach(s; taskPool.parallel(files, numParallel)) { L(s); } // L(s) represents the work to be done. to download files from the internet. Everything works. The issue is this: the foreach will download 8 files at once. BUT it will not start the next batch of 8 *until* ALL of the previous

Starting and managing threads

2023-03-24 Thread Vino via Digitalmars-d-learn
https://forum.dlang.org/post/eeqqmlojlniiihgyb...@forum.dlang.org On Sunday, 16 January 2022 at 09:38:52 UTC, Bagomot wrote: The program does nothing probably because of that continue. (?) No, it does work inside the loop. So, the event loop is in a separate thread. What should happen when

Re: Threads

2023-03-22 Thread Ali Çehreli via Digitalmars-d-learn
On 3/21/23 22:30, Tim wrote: > to make a simple multi-threading application. Unless there is a reason not to, I recommend std.concurrency and std.parallelism modules. They are different but much more simpler compared to the low-level core.thread. > args_copy = args; //Why program name

Re: Threads

2023-03-22 Thread Tim via Digitalmars-d-learn
On Wednesday, 22 March 2023 at 07:16:43 UTC, Kagamin wrote: static is thread local by default. ``` module main; import app; import core.thread; int main(string[] args) { static shared int result; static shared string[] args_copy; static void app_thread() { App app

Re: Threads

2023-03-22 Thread Tim via Digitalmars-d-learn
On Wednesday, 22 March 2023 at 07:16:43 UTC, Kagamin wrote: static is thread local by default. ``` module main; import app; import core.thread; int main(string[] args) { static shared int result; static shared string[] args_copy; static void app_thread() { App app

Re: Threads

2023-03-22 Thread Kagamin via Digitalmars-d-learn
static is thread local by default. ``` module main; import app; import core.thread; int main(string[] args) { static shared int result; static shared string[] args_copy; static void app_thread() { App app = new App(); result = app.run(args_copy); }

Threads

2023-03-21 Thread Tim via Digitalmars-d-learn
Hello! I am trying to make a simple multi-threading application. But I get an error when I run the main thread of the program in a thread. The question is: "How to pass arguments from the main thread to the newly created thread of itself". Here is a piece of code: module main; import app;

[Issue 19978] D sometimes just crashes on exit with daemon threads

2023-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
--- @RazvanN7 created dlang/dmd pull request #14907 "Fix Issue 19978 - D sometimes just crashes on exit with daemon threads" fixing this issue: - Fix Issue 19978 - D sometimes just crashes on exit with daemon threads https://github.com/dlang/dmd/pull/14907 --

[Issue 19978] D sometimes just crashes on exit with daemon threads

2023-02-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19978 --- Comment #5 from FeepingCreature --- How do you run module dtors without stopping the threads anyways? I don't see how that'd ever be safe. --

[Issue 19978] D sometimes just crashes on exit with daemon threads

2023-02-21 Thread d-bugmail--- via Digitalmars-d-bugs
erm>os_mem_unmap) Why not let the OS handle > the frees? The problem is that we have (shared) static constructors/destructors to worry about. Currently, I haven't found any information about the behavior of daemon threads in the presence of module constructors, however, my expectation is that the

[Issue 22358] Allocations from foreign threads lead to crash

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22358 Iain Buclaw changed: What|Removed |Added Priority|P1 |P2 --

[Issue 19978] D sometimes just crashes on exit with daemon threads

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19978 Iain Buclaw changed: What|Removed |Added Priority|P1 |P2 --

[Issue 16324] std.parallelism taskPool does not terminate daemon threads

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16324 Iain Buclaw changed: What|Removed |Added Priority|P1 |P2 --

[Issue 19397] Debugger does not catch unhandled exceptions in druntime threads

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19397 Iain Buclaw changed: What|Removed |Added Priority|P1 |P3 --

[Issue 13166] pause and resume threads

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13166 Iain Buclaw changed: What|Removed |Added Priority|P1 |P4 --

[Issue 21066] Druntime SIGSEGV / SIGBUS unittest signal handler should emit the stack trace for all threads

2022-07-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21066 Andrej Mitrovic changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

Re: Starting and managing threads

2022-01-16 Thread forkit via Digitalmars-d-learn
On Monday, 27 December 2021 at 10:59:07 UTC, Ali Çehreli wrote: ...my DConf Online 2020 presentation here: https://dconf.org/2020/online/#ali1 Ali Hey, that is a really great presentation! Many more people should watch it, and learn ;-)

Re: Starting and managing threads

2022-01-16 Thread Bagomot via Digitalmars-d-learn
The program does nothing probably because of that continue. (?) No, it does work inside the loop. So, the event loop is in a separate thread. What should happen when the events trigger? Do you want this thread to handle the events or should this thread send a > message to the main thread

Re: Starting and managing threads

2022-01-15 Thread Ali Çehreli via Digitalmars-d-learn
On 1/12/22 00:50, Bagomot wrote: > If I change the run method of the Guard class so that it starts a new > thread, the program just does nothing: > ```d > public void run() { > spawn((shared EventLoop eventLoop) { > while ((cast() eventLoop).loop()) { > continue; The

Re: Starting and managing threads

2022-01-15 Thread Bagomot via Digitalmars-d-learn
On Saturday, 15 January 2022 at 19:07:20 UTC, frame wrote: On Wednesday, 12 January 2022 at 08:50:09 UTC, Bagomot wrote: Why? What am I doing wrong? I guess your main() exits and just ends all threads? No, the program continues to run. And I tested it with while in main.

Re: Starting and managing threads

2022-01-15 Thread frame via Digitalmars-d-learn
On Wednesday, 12 January 2022 at 08:50:09 UTC, Bagomot wrote: Why? What am I doing wrong? I guess your main() exits and just ends all threads?

Re: Starting and managing threads

2022-01-15 Thread Bagomot via Digitalmars-d-learn
On Wednesday, 12 January 2022 at 08:50:09 UTC, Bagomot wrote: Good day! I keep giving rise to problems. Above, Tejas helped me a lot, but still doesn't work. I gave up using the fswatch library, thinking that the problem was in it. Now trying to do it using libasync. Here is the code that

Re: Starting and managing threads

2022-01-12 Thread Bagomot via Digitalmars-d-learn
Good day! I keep giving rise to problems. Above, Tejas helped me a lot, but still doesn't work. I gave up using the fswatch library, thinking that the problem was in it. Now trying to do it using libasync. Here is the code that runs on the main thread, it blocks further actions on that

Re: Starting and managing threads

2021-12-28 Thread Bagomot via Digitalmars-d-learn
Thanks! It works. Perhaps there will still be difficulties, I will write here.

Re: Starting and managing threads

2021-12-28 Thread Tejas via Digitalmars-d-learn
On Tuesday, 28 December 2021 at 16:29:05 UTC, Bagomot wrote: I can't do it according to your example, my Watcher list fills up at runtime. Yes, it's possible to do it at runtime as well(it already _was_ happening at runtime), although I'll be using a `cast` for convenience now. ```d

Re: Starting and managing threads

2021-12-28 Thread Bagomot via Digitalmars-d-learn
On Tuesday, 28 December 2021 at 15:42:04 UTC, Tejas wrote: On Tuesday, 28 December 2021 at 14:19:46 UTC, Bagomot wrote: On Monday, 27 December 2021 at 10:59:07 UTC, Ali Çehreli wrote: On 12/27/21 1:33 AM, Bagomot wrote: > separate thread, without blocking the main one. I think you can use

Re: Starting and managing threads

2021-12-28 Thread Tejas via Digitalmars-d-learn
On Tuesday, 28 December 2021 at 14:19:46 UTC, Bagomot wrote: On Monday, 27 December 2021 at 10:59:07 UTC, Ali Çehreli wrote: On 12/27/21 1:33 AM, Bagomot wrote: > separate thread, without blocking the main one. I think you can use std.concurrency there. I have a chapter here:

Re: Starting and managing threads

2021-12-28 Thread Bagomot via Digitalmars-d-learn
On Monday, 27 December 2021 at 10:59:07 UTC, Ali Çehreli wrote: On 12/27/21 1:33 AM, Bagomot wrote: > separate thread, without blocking the main one. I think you can use std.concurrency there. I have a chapter here: http://ddili.org/ders/d.en/concurrency.html Look for 'struct Exit' to

Re: Starting and managing threads

2021-12-27 Thread Ali Çehreli via Digitalmars-d-learn
On 12/27/21 1:33 AM, Bagomot wrote: > separate thread, without blocking the main one. I think you can use std.concurrency there. I have a chapter here: http://ddili.org/ders/d.en/concurrency.html Look for 'struct Exit' to see how the main thread signals workers to stop running. And some

Starting and managing threads

2021-12-27 Thread Bagomot via Digitalmars-d-learn
the main thread of the program. I tried to get my head around Thread and Fiber but still didn't figure out how to properly start and manage threads. I have using Thread turns it into a zombie when the main thread of the program ends. I will not even write my code here, because it is at the level

[Issue 22358] Allocations from foreign threads lead to crash

2021-10-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22358 thomas.bock...@gmail.com changed: What|Removed |Added CC||thomas.bock...@gmail.com ---

[Issue 22358] Allocations from foreign threads lead to crash

2021-10-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22358 --- Comment #2 from Ali Cehreli --- This is likely the same as 18063. --

[Issue 22358] Allocations from foreign threads lead to crash

2021-10-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22358 Ali Cehreli changed: What|Removed |Added CC||acehr...@yahoo.com See Also|

[Issue 22358] Allocations from foreign threads lead to crash

2021-10-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22358 Richard Cattermole changed: What|Removed |Added CC||alphaglosi...@gmail.com --- Comment #1

[Issue 22358] New: Allocations from foreign threads lead to crash

2021-10-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22358 Issue ID: 22358 Summary: Allocations from foreign threads lead to crash Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: critical

Re: GDC - program runs in one thread, DMD - in 4 threads, why?

2021-09-10 Thread eugene via Digitalmars-d-learn
On Friday, 10 September 2021 at 12:59:08 UTC, bauss wrote: It's just used to speed-up the GC. Yeah, I got the point, but to be absolutely honest, I (>20 years of C coding) do not like GC as such. I believe manual free() is not that 'hard'. And one must still release other resources. (in C I

Re: GDC - program runs in one thread, DMD - in 4 threads, why?

2021-09-10 Thread bauss via Digitalmars-d-learn
On Friday, 10 September 2021 at 12:46:36 UTC, eugene wrote: On Friday, 10 September 2021 at 12:10:58 UTC, Adam D Ruppe wrote: btw why do the threads cause you trouble? Well... probably it is subjective thing - just do not 'like' when a program is doing something that is not explicitly in it's

Re: GDC - program runs in one thread, DMD - in 4 threads, why?

2021-09-10 Thread eugene via Digitalmars-d-learn
On Friday, 10 September 2021 at 12:10:58 UTC, Adam D Ruppe wrote: btw why do the threads cause you trouble? Well... probably it is subjective thing - just do not 'like' when a program is doing something that is not explicitly in it's source (I am C coder, you guessed). More specifically - I

Re: GDC - program runs in one thread, DMD - in 4 threads, why?

2021-09-10 Thread Adam D Ruppe via Digitalmars-d-learn
btw why do the threads cause you trouble?

Re: GDC - program runs in one thread, DMD - in 4 threads, why?

2021-09-10 Thread eugene via Digitalmars-d-learn
On Friday, 10 September 2021 at 11:53:04 UTC, eugene wrote: On Friday, 10 September 2021 at 11:32:02 UTC, Adam D Ruppe wrote: You either pass as an argument *to your application* --DRT-gcopt=parallel:0 oops... :) ps xH | grep [e]cho 5727 pts/14 S+ 0:13 ./echo-server

Re: GDC - program runs in one thread, DMD - in 4 threads, why?

2021-09-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/10/21 7:47 AM, eugene wrote: On Friday, 10 September 2021 at 11:09:10 UTC, bauss wrote: --DRT-gcopt=parallel:2 on the command line. A value of 0 disables parallel marking completely. but it does not: make -f Makefile-dmd dmd --DRT-gcopt=parallel:0 engine/*.d common-sm/*.d server-sm/*.d

Re: GDC - program runs in one thread, DMD - in 4 threads, why?

2021-09-10 Thread eugene via Digitalmars-d-learn
On Friday, 10 September 2021 at 11:32:02 UTC, Adam D Ruppe wrote: You either pass as an argument *to your application* --DRT-gcopt=parallel:0 oops... :)

Re: GDC - program runs in one thread, DMD - in 4 threads, why?

2021-09-10 Thread eugene via Digitalmars-d-learn
On Friday, 10 September 2021 at 11:09:10 UTC, bauss wrote: --DRT-gcopt=parallel:2 on the command line. A value of 0 disables parallel marking completely. but it does not: make -f Makefile-dmd dmd --DRT-gcopt=parallel:0 engine/*.d common-sm/*.d server-sm/*.d pool.d echo_server.d

Re: GDC - program runs in one thread, DMD - in 4 threads, why?

2021-09-10 Thread Adam D Ruppe via Digitalmars-d-learn
On Friday, 10 September 2021 at 09:27:49 UTC, eugene wrote: What are these extra threads for? GC? So I think it is **very aggressive usage** of DList that causes this. Yeah, in newer versions, when the garbage collector does its first collect, it spawns some helper threads to speed up its

Re: GDC - program runs in one thread, DMD - in 4 threads, why?

2021-09-10 Thread eugene via Digitalmars-d-learn
On Friday, 10 September 2021 at 11:09:10 UTC, bauss wrote: Here's the specific change: https://dlang.org/changelog/2.087.0.html#gc_parallel thanx a lot!

Re: GDC - program runs in one thread, DMD - in 4 threads, why?

2021-09-10 Thread eugene via Digitalmars-d-learn
On Friday, 10 September 2021 at 10:20:52 UTC, drug wrote: It is off-topic a bit I am newbie - have been learning D for about 2 months or so. I understand that my question is not about the language itself, just picked forum for new users. but I think none can compare gdc 4.9.2 to same

Re: GDC - program runs in one thread, DMD - in 4 threads, why?

2021-09-10 Thread Mike Parker via Digitalmars-d-learn
On Friday, 10 September 2021 at 11:20:10 UTC, eugene wrote: same picture with gdc 8.4.0 - one thread, no pthread_create() behind the scenes. GDC is stuck on a much older version of D. Iain has backported some bugfixes and optimizations, but featurewise it's mostly D 2.076. This is because

Re: GDC - program runs in one thread, DMD - in 4 threads, why?

2021-09-10 Thread bauss via Digitalmars-d-learn
On Friday, 10 September 2021 at 10:39:48 UTC, Basile B. wrote: On Friday, 10 September 2021 at 09:27:49 UTC, eugene wrote: Here is test program (which is using DList aggressively) [...] Can this (really unwanted) behavior be disabled in DMD? I do not want to have multiple threads, a program

Re: GDC - program runs in one thread, DMD - in 4 threads, why?

2021-09-10 Thread Basile B. via Digitalmars-d-learn
On Friday, 10 September 2021 at 09:27:49 UTC, eugene wrote: Here is test program (which is using DList aggressively) [...] Can this (really unwanted) behavior be disabled in DMD? I do not want to have multiple threads, a program (real program, not the test above) has to be single-threaded

Re: GDC - program runs in one thread, DMD - in 4 threads, why?

2021-09-10 Thread drug via Digitalmars-d-learn
10.09.2021 12:27, eugene пишет: //import std.container.dlist; // dmd (v2.097.2) import std.container: DList; // gdc (4.9.2) It is off-topic a bit but I think none can compare gdc 4.9.2 to dmd 2.097.2 because gdc has older version than dmd. I would compare gdc to appropriate dmd version,

GDC - program runs in one thread, DMD - in 4 threads, why?

2021-09-10 Thread eugene via Digitalmars-d-learn
with dmd, program creates 3 additional threads: @dexp ~ $ ps xH | grep [t]est 3839 pts/12 Rl+0:00 ./test 3839 pts/12 Sl+0:00 ./test 3839 pts/12 Sl+0:00 ./test 3839 pts/12 Sl+0:00 ./test What are these extra threads for? To work with list (which is strange)??? GC

Re: Registering-unregistering threads

2021-08-02 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 30 July 2021 at 23:48:41 UTC, solidstate1991 wrote: Info on it is quite scarce and a bit confusing. If I unregister from the RT, will that mean it'll be GC independent, or will have other consequences too? The consequence is that the stack memory of that thread isn't traced, so

Re: Registering-unregistering threads

2021-08-02 Thread user1234 via Digitalmars-d-learn
On Friday, 30 July 2021 at 23:48:41 UTC, solidstate1991 wrote: I'm doing some audio-related work, and one thing I need is to unregister from (and maybe later temporarily re-register to) the GC, since it would cause some issues, GC + audio is only a problem if its pauses (e.g in the audio

Re: Registering-unregistering threads

2021-08-01 Thread WebFreak001 via Digitalmars-d-learn
On Friday, 30 July 2021 at 23:48:41 UTC, solidstate1991 wrote: I'm doing some audio-related work, and one thing I need is to unregister from (and maybe later temporarily re-register to) the GC, since it would cause some issues, and it would be nice if I still could use the GC during disk

Registering-unregistering threads

2021-07-30 Thread solidstate1991 via Digitalmars-d-learn
I'm doing some audio-related work, and one thing I need is to unregister from (and maybe later temporarily re-register to) the GC, since it would cause some issues, and it would be nice if I still could use the GC during disk operations, etc. Info on it is quite scarce and a bit confusing. If

[Issue 1085] Need to add ability to detach threads.

2021-05-18 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=1085 Andrew Edwards changed: What|Removed |Added Status|NEW |RESOLVED CC|

Re: Unexpected threads observed before main()

2021-03-01 Thread Keivan Shah via Digitalmars-d-learn
On Monday, 1 March 2021 at 09:03:32 UTC, rikki cattermole wrote: So it is debatable if it is a good idea to get rid of them once done (even if delayed). Makes sense, Thanks a lot for the quick help!

Re: Unexpected threads observed before main()

2021-03-01 Thread rikki cattermole via Digitalmars-d-learn
On 01/03/2021 8:02 PM, Keivan Shah wrote: If possible, Can you also help me understand that why are the threads not despawned once the GC is done collecting in this example? There was a PR about this ages ago. But one thing to consider is that keeping threads around not doing anything

Re: Unexpected threads observed before main()

2021-02-28 Thread Keivan Shah via Digitalmars-d-learn
/dlang.org/spec/garbage.html#gc_parallel). If possible, Can you also help me understand that why are the threads not despawned once the GC is done collecting in this example?

Re: Unexpected threads observed before main()

2021-02-28 Thread rikki cattermole via Digitalmars-d-learn
Do you still get them when you call your app like this? ./app --DRT-gcopt=parallel:0

Unexpected threads observed before main()

2021-02-28 Thread Keivan Shah via Digitalmars-d-learn
I had recently updated my dmd version to latest, i.e from 2.076.1 (I know, sorry) to 2.095.0 and suddenly my code has started spawning extra threads which were not there before with no obvious reasons, after trying to simplify and identify the cause as much as possible, I have come up

[Issue 21066] Druntime SIGSEGV / SIGBUS unittest signal handler should emit the stack trace for all threads

2020-07-23 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21066 --- Comment #2 from FeepingCreature --- Readable version: > A signal may be process-directed or thread-directed. [...] > A thread-directed signal is one that is targeted at a specific thread. A > signal may be > thread-directed because it was

[Issue 21066] Druntime SIGSEGV / SIGBUS unittest signal handler should emit the stack trace for all threads

2020-07-23 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21066 FeepingCreature changed: What|Removed |Added CC||default_357-l...@yahoo.de --- Comment #1

[Issue 21066] New: Druntime SIGSEGV / SIGBUS unittest signal handler should emit the stack trace for all threads

2020-07-23 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21066 Issue ID: 21066 Summary: Druntime SIGSEGV / SIGBUS unittest signal handler should emit the stack trace for all threads Product: D Version: D2 Hardware: All OS

Re: Progress printing with threads?

2020-07-01 Thread Simen Kjærås via Digitalmars-d-learn
On Wednesday, 1 July 2020 at 07:52:28 UTC, AB wrote: Hello. I am unsure how to proceed about printing progress in my program. Suppose the program is processing a very big file and is iterating the file's bytes using a for loop. The processing takes several minutes and I want a progress

Re: Progress printing with threads?

2020-07-01 Thread Stanislav Blinov via Digitalmars-d-learn
= input.length; for (ulong i = 0; i < fileSize; ++i) { // ... } If you can only update the progress between iterations I don't see why you would use threads here. A timer should suffice: import std.datetime.stopwatch; MmFile input = new MmFile(/* ... */); ul

Progress printing with threads?

2020-07-01 Thread AB via Digitalmars-d-learn
Hello. I am unsure how to proceed about printing progress in my program. Suppose the program is processing a very big file and is iterating the file's bytes using a for loop. The processing takes several minutes and I want a progress percentage be printed every 2 seconds in this manner:

[Issue 19861] core.cpuid reports the wrong number of threads

2020-05-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19861 --- Comment #10 from Dlang Bot --- dlang/druntime pull request #3107 "[dmd-cxx] fix Issue 19861 - core.cpuid reports the wrong number of threads" was merged into dmd-cxx: - d989df32ae1645203ceb24ccfa62ddfd46f078d4 by Rainer Schuetze:

[Issue 19978] D sometimes just crashes on exit with daemon threads

2020-05-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19978 --- Comment #3 from FeepingCreature --- Okay, got it. The problem is with a daemon thread, D doesn't join it when shutting down. As a result, the GC shutdown sequence deletes the thread's memory right under it. Why do we do this anyway?

Re: Integration testing, unit-threaded, and threads

2020-04-23 Thread Russel Winder via Digitalmars-d-learn
On Thu, 2020-04-23 at 14:41 +0300, drug via Digitalmars-d-learn wrote: > […] > Did you try `dub test -- -s`? Oh f###, that is about the only combination I didn't try. :-( Thanks. Problem solved. :-) Not sure about the Fixture proposal, I will research and cogitate further. -- Russel.

Re: Integration testing, unit-threaded, and threads

2020-04-23 Thread drug via Digitalmars-d-learn
after main. However I am using unit-threaded, not for the threads but because it is great for a whole load of other reasons. In fact the threads are becoming a problem. As far as I can tell main is terminating before all the tests are complete which means the shared static destructor is executing

Re: Integration testing, unit-threaded, and threads

2020-04-23 Thread drug via Digitalmars-d-learn
23.04.2020 14:41, drug пишет: terminate it after in `` terminate it after in `shutdown()`

Integration testing, unit-threaded, and threads

2020-04-23 Thread Russel Winder via Digitalmars-d-learn
-threaded, not for the threads but because it is great for a whole load of other reasons. In fact the threads are becoming a problem. As far as I can tell main is terminating before all the tests are complete which means the shared static destructor is executing before all the tests are complete. To test

[Issue 20567] GC should not start threads for parallel marking in simple programs

2020-02-09 Thread d-bugmail--- via Digitalmars-d-bugs
|--- |FIXED --- Comment #2 from Dlang Bot --- dlang/druntime pull request #2933 "fix Issue 20567 - GC should not start threads for parallel marking in simple programs" was merged into master: - 3d44d2affda45e638ed52b0c9658435b3418d7f8 by Rainer Schuetze: fix Issue 20567 -

[Issue 20567] GC should not start threads for parallel marking in simple programs

2020-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
--- @rainers created dlang/druntime pull request #2933 "fix Issue 20567 - GC should not start threads for parallel marking in simple programs" fixing this issue: - fix Issue 20567 - GC should not start threads for parallel marking in simple programs avoid collection when there is no small/

[Issue 20567] New: GC should not start threads for parallel marking in simple programs

2020-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20567 Issue ID: 20567 Summary: GC should not start threads for parallel marking in simple programs Product: D Version: D2 Hardware: All OS: All Status: NEW

Re: Constant GC allocations when sending large messages to threads?

2020-02-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/2/20 12:13 PM, cc wrote: On Friday, 31 January 2020 at 15:47:26 UTC, Steven Schveighoffer wrote: You could use RefCounted to build a struct that then is sendable with the data you need. RefCounted allocates using C malloc, not the GC. Thanks for the tips.  How exactly would I go about

Re: Constant GC allocations when sending large messages to threads?

2020-02-02 Thread cc via Digitalmars-d-learn
On Friday, 31 January 2020 at 15:47:26 UTC, Steven Schveighoffer wrote: You could use RefCounted to build a struct that then is sendable with the data you need. RefCounted allocates using C malloc, not the GC. Thanks for the tips. How exactly would I go about sending a RefCounted value?

Re: Constant GC allocations when sending large messages to threads?

2020-01-31 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/31/20 2:14 AM, cc wrote: On Wednesday, 29 January 2020 at 21:10:53 UTC, Steven Schveighoffer wrote: I'm pretty sure std.concurrency uses Variant to pass message data, which boxes when it gets over a certain size. You are probably crossing that threshold. The allocations should level out

Re: Constant GC allocations when sending large messages to threads?

2020-01-31 Thread bauss via Digitalmars-d-learn
On Friday, 31 January 2020 at 07:14:30 UTC, cc wrote: On Wednesday, 29 January 2020 at 21:10:53 UTC, Steven Schveighoffer wrote: I'm pretty sure std.concurrency uses Variant to pass message data, which boxes when it gets over a certain size. You are probably crossing that threshold. The

Re: Constant GC allocations when sending large messages to threads?

2020-01-30 Thread cc via Digitalmars-d-learn
On Wednesday, 29 January 2020 at 21:10:53 UTC, Steven Schveighoffer wrote: I'm pretty sure std.concurrency uses Variant to pass message data, which boxes when it gets over a certain size. You are probably crossing that threshold. The allocations should level out eventually when the GC starts

Re: Constant GC allocations when sending large messages to threads?

2020-01-29 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/29/20 2:48 PM, cc wrote: Given the sample program at https://pastebin.com/u9sSNtj7 I'm experiencing GC allocations with every call to std.concurrency.send when sending larger messages (e.g. multiple ulongs).  These do not occur when sending uints in comparison, in the provided example.

Constant GC allocations when sending large messages to threads?

2020-01-29 Thread cc via Digitalmars-d-learn
Given the sample program at https://pastebin.com/u9sSNtj7 I'm experiencing GC allocations with every call to std.concurrency.send when sending larger messages (e.g. multiple ulongs). These do not occur when sending uints in comparison, in the provided example. For example, when the

[Issue 13330] Calling std.c.stdlib.exit() from child threads causes segfault

2019-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13330 moonlightsenti...@disroot.org changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 5488] Spawned threads hang in a way that suggests allocation or gc issue

2019-12-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5488 berni44 changed: What|Removed |Added Status|ASSIGNED|RESOLVED CC|

[Issue 19978] D sometimes just crashes on exit with daemon threads

2019-12-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19978 Gregor Mückl changed: What|Removed |Added CC|gregormue...@gmx.de | Severity|normal

  1   2   3   4   5   6   7   8   9   10   >