World: r3wp
[!Cheyenne] Discussions about the Cheyenne Web Server
older newer | first last |
Pekr 28-Dec-2009 [6840] | Here's some prior info on tasks gathered from Carl's replies in September: The model is: threaded CPU, shared memory, shared symbol space, shared system function space, separate evaluation stacks, separate user contexts. Intertask comm is via Ports. Sync is via ports. BTW, "ports" does not need to mean "sockets". The host level can provide a more direct mechanism for inter-task sync and comm. I'm not a fan of locking, but sometimes it's necessary. Otherwise, mods can be "cloned" for multi-task uniqueness. |
Steeve 28-Dec-2009 [6841x2] | what is the interest of intertask comm if we got shared memory ? |
Actually, if i'm not wrong. Tasks are switched every 0.001 second (wiich might be too slow for huge task handler, like uniserve). The only thing missing currently, is the ability to switch tasks prior the next switch event. A RESUME or SWITCH function, could allow that. To switch to the next waiting task in the queue immedialty. | |
Dockimbel 28-Dec-2009 [6843] | On which OS are you testing? |
Steeve 28-Dec-2009 [6844] | Vista |
BrianH 28-Dec-2009 [6845] | what is the interest of intertask comm if we got shared memory ? Shared memory needs coordination to manage the shared access. Intertask communication allows tasks to share less, which makes the whole more scalable. Plus it can turn into interprocess or intercomputer communication without changing algorithms, which makes it even more scalable. |
Kaj 28-Dec-2009 [6846] | Threading on POSIX is unimplemented. If it works on Windows, it's by accident. It's unfinished and untested |
Carl 28-Dec-2009 [6847x2] | Yes, but one of us (not me) can help work on it. |
Start by providing the __attribute__ for thread-locals, assuming that the .so supports that. If not, we'll need to move the thread local vars into a struct, and allocate it dynamically. However, we'll still need at least one thread-local from the host kit side, to provide the base pointer for each thread. | |
Pekr 28-Dec-2009 [6849] | Carl - you said: The model is: threaded CPU, shared memory, shared symbol space, shared system function space, separate evaluation stacks, separate user contexts. Intertask comm is via Ports. Sync is via ports. BTW, "ports" does not need to mean "sockets". Does it mean the code is in the Host, not in the kernel? |
Carl 28-Dec-2009 [6850x2] | Yes, most of the work is in the Host. |
However, the kernel uses thread-local variables.... which are not currently enabled on Posix builds. | |
Pekr 28-Dec-2009 [6852] | without task!, Doc can't start moving Cheyenne (our premium product) to R3. He recently added early support for websockets protocol .... |
Carl 28-Dec-2009 [6853x3] | Pekr, I'm not so sure that's true. |
The only advantage of task! is about 1MB of memory. Otherwise, you can fire up multiple R3 processes and communicate between them. | |
We have the old R2 IPC code here that we could use for quick messages between procs. | |
Pekr 28-Dec-2009 [6856x2] | I know what you mean. It could be ported, but model would be the same as in R2 - multiplexing, spawned tasks. But I think Doc might be interested in using threads instead, so my bet is he will wait, until it gets finished ... |
Yes, I think that ppl expect task having some schemes around them, to allow IPC. IMO what was wrong with R2 was, that we (as a community plus RT) never "standardised" on such things ... | |
Carl 28-Dec-2009 [6858] | Of course, the other benefit is that in sharing symbols, we could pass full blocks (not text) between task!s. |
Pekr 28-Dec-2009 [6859] | So most ppl (let's say average coders) ended up with the possibility to spawn new R2 processes, but not knowing how to properly sync them to communicate ... |
Carl 28-Dec-2009 [6860] | Well, I'd like to see a lot more standards in R3. At least, I'm planning a few std modules for all the common stuff we use here. |
Pekr 28-Dec-2009 [6861] | I think that many ppl here think that the priority of importance is: - host release - host support of View (merge of DELECT and command type) - Extensions supporting Devices, callbacks - tasking, IPC then beta .... If you postpone anything from above to 3.1, some ppl will wait for 3.1 ... do you want to bet with me? :-) |
Carl 28-Dec-2009 [6862x2] | I think you are correct. But, as soon as we are confident in 3.0, we should put it out, even if missing a few features. |
For example, the new REBOL.com website runs on R3 scripts. | |
Pekr 28-Dec-2009 [6864] | I am fully for R3, and to not look back. Did you notice, how positive reactions you got to initial Host release? Hopefully that cooperative aproach works. But in some areas, we NEED design leadership. So - that is why I put a note to my "marketing" related docs, stating that simply transferring the responsibility to the community, might not see the features delivered. So - maybe you could blog a bit - hey, guys, tasking's next. If you want it, try to prepera following details for me .... 1) 2) 3), etc. |
Carl 28-Dec-2009 [6865] | I totally agree with you here. In fact, I won't accept anything that does not meet my requirements. |
Pekr 28-Dec-2009 [6866x4] | yes, so hopefully you can now understand, why I objected to your (taken from Project plan) words: "Also, this list is only for R3 core operation and does not include community-based projects such as graphics, GUI, protocols, documentation, and other features that can be developed externally, depending on the needs of the community." |
I can (well, maybe I even can't :-) imagine, how picky you might be about the code quality. So it is really not imo enought to state - hey, guys, here's host code, who does the best task implementation, wins a bottle of Rebol wine :-) | |
I know that BrianH might not agree with me. Community can do some research, reference implementation, but I would expect stuff like tasks being DESIGNED (not implemented) by the author of first multitasking operating system himself :-) | |
OK, going to sleep, 2:30 here ... and soon enough Doc might jump here, that I turned his group off-topic ... | |
Kaj 28-Dec-2009 [6870] | Steeve seemed to imply that R3 has its own thread scheduler. Is that true? |
Carl 28-Dec-2009 [6871] | No. |
Kaj 28-Dec-2009 [6872] | I thought so :-) |
Carl 28-Dec-2009 [6873] | I think he's referring to the R3 Device timeslicer. |
Kaj 28-Dec-2009 [6874] | Is that based on async I/O or something? |
Carl 28-Dec-2009 [6875x5] | Yes. |
But not all devices are async. | |
So, if no devices have "work to do" then we sleep for a short period of time (as long as that period is greater than the minimum dispatch time for the host CPU.) | |
We have more adjustments to make on this. E.g. OS X burns extra CPU. | |
I thought Henrik would have it fixed by now. ;-) | |
Kaj 28-Dec-2009 [6880] | Ah, I remember that. Good info |
Henrik 29-Dec-2009 [6881] | Carl, I'm not a C programmer, so I can't fix that stuff. :-) |
Endo 29-Dec-2009 [6882] | @doc: is there macos version of cheyenne? |
Henrik 29-Dec-2009 [6883] | Endo, I run Cheyenne off my macbook, script version, though. Runs fine. |
Endo 29-Dec-2009 [6884] | Thx. Does not it require be compiled? Console should be stay open I guess, there is no service edition on MacOS? |
Henrik 29-Dec-2009 [6885x2] | No compilation necessary. Services are builtin: launchd |
I use Lingon to create services and then use the launchd console to load and manage services. | |
Endo 29-Dec-2009 [6887] | Ok. Thanks a lot. |
Dockimbel 29-Dec-2009 [6888] | Endo: you can run it on OS X either from sources or using a binary version from here : http://cheyenne-server.org/download.shtml |
Endo 29-Dec-2009 [6889] | Doc: is this the session-problem fixed version? or it was only a windows related problem? |
older newer | first last |