Search the web
Sign In
New User? Sign Up
cheapthreads · cheap_threads
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Need more doc for funciton prototypes' parameters   Message List  
Reply | Forward Message #9 of 89 |
Re: [cheapthreads] Need more doc for funciton prototypes' parameters

See response below...

gordonwkf wrote:
>
> Dear Sir
> Can you write more doc for funciton prototypes' parameters? Which
> make it more easy to use? Are there any more examples?
>
> Gordon From Hong Kong
> thx

I tried to provide detailed documentation, but there's always
room for improvement.

Which parameters are you having problems with?

As for examples...

One weakness of the website, as it stands now, is that it has only
one example -- the cttimer program, which may be too simple to be
very helpful.

I'm not sure how to provide good examples. In order to demonstrate
anything beyond the simplest concepts, a program may have to be
complicated enough that it's hard to follow. Just to have one
thread send a message to another, I need to create the threads
and call ct_schedule(). Then one of the threads has to send a
message, and the other has to receive it and somehow show that it
has received it. Then they have to both terminate or go to sleep,
or one of them has to call ct_halt(). I don't know how many people
would want to wade through several hundred lines of code just to
see an example of one simple thing.

Another problem is that it's hard to show that multiple threads are
running without some kind of graphical display. The main program
that I use for testing puts some blinking lights on the screen, one
thread per light, plus a couple of other threads to read the
keyboard and control the timing of the blinks. However this program
depends on some compiler-specific function calls for controlling the
display. I don't want to use it for an example because it's not
portable. About all I can do portably is to have different threads
write different lines of text. That's not very exciting, but I'm
not sure how to do better.

The attachment contains an example slightly more complex than the
cttimer program. Two threads take turns writing to standard output.
Each thread runs for a different number of iterations. The main thing
that this program demonstrates is that two threads can run the same
code but behave differently, because they store different values in
their thread-private data.

In order to get the attachment you may need to be a member of the
mailing list (I don't know exactly how Yahoo handles attachments).
One of these days I'm planning to put this example up on the website.
Until then, if you're not a member you can ask me for a copy by
private email.

Scott McKellar mck9@...
http://home.swbell.net/mck9/ct/

Thu Aug 7, 2003 2:07 am

jm407a
Offline Offline
Send Email Send Email

Attachment
Ababab.c
Type:
application/x-unknown-content-type-C_auto_file
Forward
Message #9 of 89 |
Expand Messages Author Sort by Date

Dear Sir Can you write more doc for funciton prototypes' parameters? Which make it more easy to use? Are there any more examples? Gordon From Hong Kong thx...
gordonwkf
gordonwkf@...
Send Email
Aug 6, 2003
5:59 am

See response below... ... I tried to provide detailed documentation, but there's always room for improvement. Which parameters are you having problems with? As...
Scott McKellar
jm407a
Offline Send Email
Aug 7, 2003
2:06 am

May be lessions of 1(thread) to 1(thread), 1 to many, manay to manay? Anyway, when I get time to read over your source code, I will provide some example for...
gordonwkf
gordonwkf@...
Send Email
Aug 9, 2003
11:52 am

It would be nice to have examples of message-passing code, using the three different ways of passing messages: to a single thread, to a class of subscribed...
Scott McKellar
jm407a
Offline Send Email
Aug 9, 2003
9:30 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help