Fibers patch

3 views
Skip to first unread message

Malcolm Handley

unread,
Oct 20, 2010, 6:32:12 PM10/20/10
to v8...@googlegroups.com
Attached is a patch that adds a simple fibers API to v8cgi. It probably doesn't work on all platforms but we have tested it on the mac and linux. And it's a module so it shouldn't hurt people who don't want it.
fibers_patch.txt

Darrell Brogdon

unread,
Oct 20, 2010, 6:44:38 PM10/20/10
to v8...@googlegroups.com
Curious. What are Fibers? I'd usually search before asking but I suspect I'd get a massively un-useable result on a word like that. :)

-D


On Oct 20, 2010, at 4:32 PM, Malcolm Handley wrote:

> Attached is a patch that adds a simple fibers API to v8cgi. It probably doesn't work on all platforms but we have tested it on the mac and linux. And it's a module so it shouldn't hurt people who don't want it.
>

> --
> You received this message because you are subscribed to the Google Groups "v8cgi" group.
> To post to this group, send email to v8...@googlegroups.com.
> To unsubscribe from this group, send email to v8cgi+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/v8cgi?hl=en.
> <fibers_patch.txt>

Malcolm Handley

unread,
Oct 20, 2010, 7:04:53 PM10/20/10
to v8...@googlegroups.com
This is a good page to start with: http://en.wikipedia.org/wiki/Fiber_(computer_science)

Ondřej Žára

unread,
Oct 21, 2010, 2:43:12 AM10/21/10
to v8...@googlegroups.com
Hi Malcom,

thanks a lot! This looks like a very nice and cool contribution.

1) applying with patch -p0 < ... results in
patch: **** malformed patch at line 34: def build_mysql(env):

what am I doing wrong?


2) your patch also modifies SConstruct so it expects "profile" and "memcached" modules to be defined. Are you able to supply also these? :)



Thanks,
Ondrej





2010/10/21 Malcolm Handley <mal...@asana.com>
Attached is a patch that adds a simple fibers API to v8cgi. It probably doesn't work on all platforms but we have tested it on the mac and linux. And it's a module so it shouldn't hurt people who don't want it.

--

Malcolm Handley

unread,
Oct 22, 2010, 2:50:08 PM10/22/10
to v8...@googlegroups.com
Sorry. I think that both of these problems were caused by my trying to split our changes into smaller patches to give you. I can still do that if you want but this time I'm attaching a patch with almost all of our changes.

Here's what the patch does:

- fixes DOMParser.prototype._unescapeEntities to globally unescape (versus just the first match). (dom.js)
- adds a flush() method to File. (fs.js)
- adds a fiber api (v8cgi.cc, src/lib/fibers, SConstruct)
- adds support for enabling v8's profiler from JS (src/lib/profiler, SConstruct)
- adds a memcached client (src/lib/memcached, SConstruct)
- adds support for passing an environment when running subprocesses (process.cc)
- adds getpid (system.cc)
- links against the debug version of v8 when built with the debug flag (SConstruct). This may not be what you want but we find it useful to use a debug v8 when testing changes to v8cgi. (We like to get real stack traces, for example.)

I have applied this patch myself.

We have tests for many of these changes but they are written in our on JS testing framework. You are welcome to them if you like, though.
v8cgi_patch.txt

Ondřej Žára

unread,
Oct 25, 2010, 9:49:08 AM10/25/10
to v8...@googlegroups.com
Hi Malcom,

thanks a lot for your contribution. I just commited it with only very minor cosmetic changes, such as removal of unnecessary includes. I also need to test your new libraries (fibes, profiler, memcached) on Windows and adjust the build process accordingly.

I now need to properly document your three new modules. Are you able to provide the documentation (similar as other modules) in Google Code Wiki format? Alternatively, I can make you a project memeber, so you can edit wiki yourself. This seems to be a better alternative, as it allows you to commit fixes for these modules when necessary...


Thank your again,
Ondrej Zara




2010/10/22 Malcolm Handley <mal...@asana.com>

Malcolm Handley

unread,
Oct 25, 2010, 1:43:54 PM10/25/10
to v8...@googlegroups.com
On Mon, Oct 25, 2010 at 06:49, Ondřej Žára <ondre...@gmail.com> wrote:
Hi Malcom,

thanks a lot for your contribution. I just commited it with only very minor cosmetic changes, such as removal of unnecessary includes. I also need to test your new libraries (fibes, profiler, memcached) on Windows and adjust the build process accordingly.

Excellent. Thanks! 

I now need to properly document your three new modules. Are you able to provide the documentation (similar as other modules) in Google Code Wiki format? Alternatively, I can make you a project memeber, so you can edit wiki yourself. This seems to be a better alternative, as it allows you to commit fixes for these modules when necessary...

I'd be happy to be a project member and add the docs and commit changes directly. The one problem is that I don't have any Windows machines to test on so I'd be worried about breaking the build for Windows.

Ondřej Žára

unread,
Oct 25, 2010, 2:05:12 PM10/25/10
to v8...@googlegroups.com
I now need to properly document your three new modules. Are you able to provide the documentation (similar as other modules) in Google Code Wiki format? Alternatively, I can make you a project memeber, so you can edit wiki yourself. This seems to be a better alternative, as it allows you to commit fixes for these modules when necessary...

I'd be happy to be a project member and add the docs and commit changes directly. The one problem is that I don't have any Windows machines to test on so I'd be worried about breaking the build for Windows.
 

As for Windows build, no problem, I can handle that. I have a virtualized windows machine which I use for building v8cgi...

Please let me know what your gmail e-mail is, so I can add you as a project member.


O.

 

Malcolm Handley

unread,
Oct 25, 2010, 4:31:44 PM10/25/10
to v8...@googlegroups.com
On Mon, Oct 25, 2010 at 11:05, Ondřej Žára <ondre...@gmail.com> wrote:

I now need to properly document your three new modules. Are you able to provide the documentation (similar as other modules) in Google Code Wiki format? Alternatively, I can make you a project memeber, so you can edit wiki yourself. This seems to be a better alternative, as it allows you to commit fixes for these modules when necessary...

I'd be happy to be a project member and add the docs and commit changes directly. The one problem is that I don't have any Windows machines to test on so I'd be worried about breaking the build for Windows.
 

As for Windows build, no problem, I can handle that. I have a virtualized windows machine which I use for building v8cgi...

Please let me know what your gmail e-mail is, so I can add you as a project member.

Ondřej Žára

unread,
Oct 26, 2010, 4:27:53 AM10/26/10
to v8...@googlegroups.com
Please let me know what your gmail e-mail is, so I can add you as a project member.

--


You are now a member :)


O.

 
Reply all
Reply to author
Forward
0 new messages