[Win32utils-devel] win32-job 0.1.0 released!

Heesob Park phasis at gmail.com
Wed Feb 5 14:57:53 UTC 2014


Hi,

2014-02-05 Daniel Berger <djberg96 at gmail.com>:
> Hi all,
>
> I've released win32-job 0.1.0 today. It's an interface for Windows jobs
> (i.e. process groups). Please take a look and let me know what you think.
>
> https://github.com/djberg96/win32-job

I think win32-job has some duplicated functionality with win32-process.

>
> About the only thing I'd like to implement in the future is a wait method. I
> tried to implement one using an approach similar to this one:
>
> http://blogs.msdn.com/b/oldnewthing/archive/2013/04/05/10407778.aspx
>
> I couldn't make it work, though. It may be the wrong approach anyway. Ideas
> welcome.
>
The access denied errors in AssignProcessToJobObject means the process
is alreay assigned to job object.
I committed a working version of wait method.

Here is a sample code.

require 'win32/job'
include Win32

pid1 = Process.spawn("notepad.exe")
pid2 = Process.spawn("notepad.exe")
sleep 0.5

j = Job.new('test')

j.configure_limit(
  :breakaway_ok      => true,
  :kill_on_job_close => true,
  :process_memory    => 1024 * 8,
  :process_time      => 10000
)

j.add_process(pid1)
j.add_process(pid2)

j.wait
puts "WAIT END"


Regards,
Park Heesob


More information about the win32utils-devel mailing list