Hide this comment

Small usage example, and I'll translate it and post to russian community.

By on 6/16/2010 2:15 AM ()Reply
Hide this comment

@LOST

let chan = Channel<string>()

let fiber1 =

fiber {

do! chan.Send "Hi"

// give control to the other fiber

yield None

do! chan.Send "Bye"

// finish

yield Some()

}

let rec printer =

fiber {

let! msg = chan.Recieve()

yield None

printfn "%s" msg

yield! printer }

Fiber.RunAll()

@anotheraccount

These can't be compared with the TPL these do not actually run in the background these are just useful when need spawn off thousands of tasks and only then will they run faster than TPL tasks. Currently im working on something to combine this with the TPL the result of that will be called a smart thread.

By on 7/18/2010 1:03 PM ()Reply
Hide this comment

Sounds interesting, but I didn't manage to compile your code. Seems like you use the deprecated syntax for seq (but I'm not sure).

Could you have a look? Thanks!

By on 2/5/2010 6:16 PM ()Reply
Hide this comment

@Stinger,

i fixed it.

Sincerely,

Saagar

By on 2/19/2010 1:19 PM ()Reply
Hide this comment

Do you have any example code/test that compare this impl to TPL tasks?

By on 6/15/2010 12:56 PM ()Reply
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper

Logging in...