summary refs log tree commit diff
path: root/src/rt/rust_uv.cpp
AgeCommit message (Collapse)AuthorLines
2012-04-27std: add ll::loop_refcount binding for uv_loop_refcountJeff Olson-0/+5
2012-04-20whitespace cleanupJeff Olson-1/+1
2012-04-20std: get_monitor_task_gl() is global_loop::get() defaultJeff Olson-0/+5
2012-04-20replace impl of globa_async_handle with one using atomic compare-and-swapJeff Olson-5/+1
2012-04-20don't use ::malloc for initializing the global_async_handle in rust_kernelJeff Olson-4/+0
2012-04-20rt: whitespace cleanup for existing libuv integrationJeff Olson-9/+9
2012-04-20bindings to get/set data field on uv_loop_t* and debug log cleanupJeff Olson-11/+23
2012-04-20add needed fields for global libuv loop + bindings to manage from rustJeff Olson-0/+21
adding two pointers fields to rust_kernel :( .. have to do manual malloc/free for one of the fields, which feels wrong
2012-04-20adding low-level uv_timer_* stuff to libuv bindingsJeff Olson-4/+19
2012-04-20making brson's req. cleanups in #2134 plus change printf to LOG in c++Jeff Olson-12/+24
2012-04-06removing some unneeded native fn mappingsin uv.rs and misc cleanJeff Olson-14/+5
.. 32bit linux issues persist.
2012-04-06experimenting with a different uv_buf_init impl to placate 32bit linuxJeff Olson-2/+17
2012-04-06whitespace cleanup after rebaseJeff Olson-134/+127
2012-04-06add libuv error msg helpers.. flushing out windows tcp issue.Jeff Olson-0/+12
2012-04-06add low-level uv_async bindings for use in tcp testJeff Olson-8/+19
2012-04-06hello world test for a tcp server in libuvJeff Olson-25/+48
.. im now going to refactor the tcp request and server tests to utilize each other, so no more external network ugliness
2012-04-06fixing libuv stuff in win32 (see #2064) .. pass sockaddr_in by-ref, for nowJeff Olson-3/+5
2012-04-06test_uv_tcp_request() fully working on linuxJeff Olson-0/+5
.. up next: windows! .. impl'd uv::direct::read_stop() and uv::direct::close() to wrap things up .. demonstrated sending data out of the uv_read_cb via a channel (which we block on to recv all of it, complete w/ EOF notification) that is read from after the loop exits. .. helpers to read the guts of a uv_buf_t .. an idea im kicking around: starting to pile up all of these hideous data accessor functions in uv::direct .. I might make impl/iface pairs for the various uv_* types that I'm using, in order to encapsulate those data access functions and, perhaps, make the access look a little cleaner (it still won't be straight field access, but it'll be a lot better) .. formatting cleanup to satisfy make check
2012-04-06wired up uv_read_start and some helper funcs around uv_alloc_cb tasksJeff Olson-1/+30
2012-04-06uv_buf_t's for uv_write() passed by-val .. no more mallocs or ptr cop-outsJeff Olson-14/+4
so we're now adhering the libuv C api and passing structs by-val where it is expected, instead of pulling pointer trickery (or worse having to malloc structs in c++ to be passed back to rust and then into C again)
2012-04-06fixed by-val from rust->c, use ++ sigil in native fn sig <-- NEVAR FORGETJeff Olson-5/+12
have to use ++ sigil in rust-side extern fn decls in order to have rust actually copy the struct, by value, onto the C stack. gotcha, indeed. also adding a helper method to verify/remind how to pass a struct by-val into C... check out the rust fn sig for rust_uv_ip4_test_verify_port_val() for more infos
2012-04-06fixed passing in uv_buf_t ptr array in uv_write.. return status 0Jeff Olson-2/+8
ways to go, still..
2012-04-06uv_write works, buffer passing still broke, can get sockaddr_in by valJeff Olson-7/+4
.. but passing sockaddr_in by val back to C is broken, still passing by ptr .. the uv_write_cb is processed, but we have a status -1.. there is also valgrind spew.. so buf passing is broken, still.
2012-04-06impl of rustrt::rust_uv_write in c++ and whitespace cleanupJeff Olson-37/+46
2012-04-06some more stuff for libuv dealing w/ 1402.. should go away soonJeff Olson-2/+15
2012-04-06adding uv::direct and beginning to work out tcp request caseJeff Olson-0/+100
lots of changes, here.. should've commited sooner. - added uv::direct module that contains rust fns that map, neatly, to the libuv c library as much as possible. they operate on ptrs to libuv structs mapped in rust, as much as possible (there are some notable exceptions). these uv::direct fns should only take inputs from rust and, as neccesary, translate them into C-friendly types and then pass to the C functions. We want to them to return ints, as the libuv functions do, so we can start tracking status. - the notable exceptions for structs above is due to ref gh-1402, which prevents us from passing structs, by value, across the Rust<->C barrier (they turn to garbage, pretty much). So in the cases where we get back by-val structs from C (uv_buf_init(), uv_ip4_addr(), uv_err_t in callbacks) , we're going to use *ctypes::void (or just errnum ints for uv_err_t) until gh-1402 is resolved. - using crust functions, in these uv::direct fns, for callbacks from libuv, will eschew uv_err_t, if possible, in favor a struct int.. if at all possible (probably isn't.. hm.. i know libuv wants to eventually move to replace uv_err_t with an int, as well.. so hm). - started flushing out a big, gnarly test case to exercise the tcp request side of the uv::direct functions. I'm at the point where, after the connection is established, we write to the stream... when the writing is done, we will read from it, then tear the whole thing down. overall, it turns out that doing "close to the metal" interaction with c libraries is painful (and more chatty) when orchestrated from rust. My understanding is that not much, at all, is written in this fashion in the existant core/std codebase.. malloc'ing in C has been preferred, from what I've gathered. So we're treading new ground, here!
2012-04-03rt: Include the correct header for alloca on windowsBrian Anderson-4/+4
2012-04-03rt: alloca is spelled differently on win32Brian Anderson-0/+4
2012-04-03rt: Fix the 0 bytes lost issueBrian Anderson-0/+16
This is a workaround for #1815. libev uses realloc(0) to free the loop, which valgrind doesn't like. We have suppressions to make valgrind ignore them. Valgrind also has a sanity check when collecting allocation backtraces that the stack pointer must be at least 512 bytes into the stack (at least 512 bytes of frames must have come before). When this is not the case it doesn't collect the backtrace. Unfortunately, with our spaghetti stacks that valgrind check triggers sometimes and we don't get the backtrace for the realloc(0), it fails to be suppressed, and it gets reported as 0 bytes lost from a malloc with no backtrace. This fixes the issue by alloca'ing 512 bytes before calling uv_loop_delete
2012-04-03Refactor includes structure, getting rid of rust_internal.hJon Morton-1/+3
Many changes to code structure are included: - removed TIME_SLICE_IN_MS - removed sychronized_indexed_list - removed region_owned - kernel_owned move to kernel.h, task_owned moved to task.h - global configs moved to rust_globals.h - changed #pragma once to standard guard in rust_upcall.h - got rid of memory.h
2012-04-02Add global rust_get_current_taskJon Morton-2/+2
Previously two methods existed: rust_sched_loop::get_task and rust_task::get_task_from_tcb. Merge both of them into one, trying the faster one (tcb) first, and if that fails, the slower one from the tls.
2012-04-01Merge remote-tracking branch 'brson/mainthread'Brian Anderson-2/+2
Conflicts: src/rt/rust_sched_loop.cpp src/rt/rust_shape.cpp src/rt/rust_task.cpp
2012-03-31rt: Fix whitespaceBrian Anderson-53/+53
2012-03-31rt: Rename rust_task_thread to rust_sched_loopBrian Anderson-2/+2
This class no longer represents a thread; it just schedules tasks.
2012-02-28add uv::loop_delete()Jeff Olson-2/+8
because of the last change, the loop ptr is no longer cleaned up when the loop exits. This api call addresses that. Sadly, the loop ptr is not "reusable" across multiple calls to uv::run().
2012-02-28correcting for libuv behavior that differs between linux & windowsJeff Olson-16/+2
net complexity increase :/
2012-02-28moving new uv stuff into uv.rs and rust_uv.cppJeff Olson-27/+159
- removing the remains of uvtmp.rs and rust_uvtmp.rs - removing the displaced, low-level libuv bindings in uv.rs and rust_uv.cpp
2012-01-22std: Add some hacks to use libuvBrian Anderson-0/+1
2011-12-01stdlib: Implement some preliminary libuv bindingsBrian Anderson-0/+50
std::uv is intended to be low-level, exactly mirroring the C API. Difficult to continue the implementation now without scheduler improvements.
2011-11-07Rename rust_uv.cpp to rust_aio.cppBrian Anderson-325/+0
2011-10-04rt: Switch the AIO stuff to the C stackPatrick Walton-18/+16
2011-10-03rt: Switch the libuv bindings over to not using explicit task pointersPatrick Walton-17/+27
2011-10-03rt: Fix comment typo in rust_uv.cppPatrick Walton-1/+1
2011-09-23Update to libuv commit 3ca382.Erick Tryzelaar-43/+35
This patch changes libuv's gyp build system to make it's own makefiles. To generate them for rust, run these commands. They requires python 2.x to work: $ mkdir -p src/rt/libuv/build $ svn co http://gyp.googlecode.com/svn src/rt/libuv/build/gyp $ ./etc/src/gyp_uv
2011-08-29Implement non-internal ivecsMarijn Haverbeke-12/+9
Vectors are now similar to our old, pre-internal vectors, except that they are uniquely owned, not refcounted. Their name should probably change too, then. I've renamed them to vec in the runtime, will do so throughout the compiler later.
2011-08-16Removed trans_comm.rs from the compiler. Updating aio/sio to work with the ↵Eric Holk-6/+26
new chan and port system, started on a networking module for the standard library.
2011-08-05Fix uv_buf_t declaration on win32Brian Anderson-0/+8
The fields of this structure are mysteriously defined in the opposite order on windows as on unix
2011-08-05Update libuv to revision ee599ec1141cc48f895de1f9d148033babdf9c2aRob Arnold-15/+15
2011-08-05Basic async IO module using libuvRob Arnold-0/+300