Opened 9 years ago

Last modified 16 months ago

#2123 new task

implement waitForProcess using signals

Reported by: simonmar Owned by: snoyberg
Priority: lowest Milestone:
Component: Core Libraries Version: 6.8.2
Keywords: Cc: redneb@…, core-libraries-committee@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

waitForProcess currently calls waitpid with a safe FFI call, which means that

  • you need to use -threaded to call this in a multithreaded program
  • one OS thread is needed per waitProcess

instead we could implement this using the IO manager: have waitForProcess communicate with the IO manager, which wakes up the client when the appropriate SIGCHLD is received. Note that this means hooking SIGCHLD so we'd interact badly if the program itself wanted to use SIGCHLD.

I think it was Duncan Coutts who mentioned this idea to me.

Change History (20)

comment:1 Changed 9 years ago by duncan

The other advantage is that ProcessHandles become safe to discard/forget without ending up with defunct zombie processes under Unix.

comment:2 Changed 9 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:3 Changed 9 years ago by simonmar

Operating System: UnknownUnknown/Multiple

comment:4 Changed 8 years ago by igloo

Milestone: 6.10 branch6.12 branch

comment:5 Changed 8 years ago by simonmar

difficulty: Moderate (1 day)Moderate (less than a day)

comment:6 Changed 7 years ago by igloo

Milestone: 6.12 branch6.12.3

comment:7 Changed 7 years ago by igloo

Milestone: 6.12.36.14.1
Priority: normallow

comment:8 Changed 6 years ago by igloo

Milestone: 7.0.17.0.2

comment:9 Changed 6 years ago by igloo

Milestone: 7.0.27.2.1

comment:10 Changed 6 years ago by igloo

Milestone: 7.2.17.4.1

comment:11 Changed 5 years ago by igloo

Milestone: 7.4.17.6.1
Priority: lowlowest

comment:12 Changed 5 years ago by igloo

Milestone: 7.6.17.6.2

comment:13 Changed 3 years ago by redneb

Cc: redneb@… added
Type of failure: None/Unknown

comment:14 Changed 3 years ago by thoughtpolice

Milestone: 7.6.27.10.1

Moving to 7.10.1.

comment:15 Changed 3 years ago by thoughtpolice

Component: libraries/processCore Libraries
Owner: set to ekmett

Moving over to new owning component 'Core Libraries'.

comment:16 Changed 2 years ago by thoughtpolice

Milestone: 7.10.17.12.1

Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

comment:17 Changed 2 years ago by thoughtpolice

Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

comment:18 Changed 2 years ago by snoyberg

Cc: core-libraries-committee@… added
Owner: changed from ekmett to snoyberg

comment:19 Changed 21 months ago by thoughtpolice

Milestone: 7.12.18.0.1

Milestone renamed

comment:20 Changed 16 months ago by thomie

Milestone: 8.0.1
Note: See TracTickets for help on using tickets.