Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1266 (new defect)

Opened 16 years ago

Last modified 15 years ago

Complete threading chapter

Reported by: larsivi Assigned to: mclysenk
Priority: major Milestone: Documentation
Component: Core Functionality Version: 0.99.7 Dominik
Keywords: threading documentation Cc:

Description

See this forum post.

Attachments

fiberContainer.d (2.0 kB) - added by Cyborg16 on 01/29/09 13:35:06.
Tidied up the visitor's calling

Change History

08/24/08 21:27:25 changed by larsivi

I hope you have time to finish it, Mik :)

01/29/09 13:08:58 changed by Cyborg16

Well, I finally worked out how to do this.. it works for me.

All the nodes need to share the same fiber, plus there has to be some way of passing back the element on each visit, so I decided to pass another class instance as the fiber object.

01/29/09 13:35:06 changed by Cyborg16

  • attachment fiberContainer.d added.

Tidied up the visitor's calling

01/29/09 13:43:20 changed by Cyborg16

Thought up a little improvement over lunch ;)

Example:

./fiberContainer 10 400 90 5 2 8
All values less than 100:
value: 2
value: 5
value: 8
value: 10
value: 90

I presume it's perfectly acceptable to destroy a Fiber when its function has partially run but not completed.

Lars/tango devs: Fiber.call's return value indicating whether or not the fiber has finished strikes me as more useful than returning an exception in general. Of course some way of getting exceptions back may be necessary, but a second little call function like mine (but renamed) could be quite useful. Minor point though.