Search found 81 matches

by ckoehler
Wed Aug 25, 2010 8:10 pm
Forum: NetBurner Software
Topic: OSSemPendNoWait
Replies: 3
Views: 1290

Re: OSSemPendNoWait

Interesting, I didn't think about that. I guess when I hear "task" I think "semaphore/critical section/etc". So there won't be any problems with just a volatile boolean if two tasks want to access it? Nice!
by ckoehler
Wed Aug 25, 2010 11:36 am
Forum: NetBurner Software
Topic: OSSemPendNoWait
Replies: 3
Views: 1290

OSSemPendNoWait

Hi,

When I use OSSemPendNoWait, and the semaphore is 0, i.e. has not been posted to, it will return OS_TIMEOUT, right? And then move on?

I want to use it in a loop and have some other task post to the semaphore when I need to break out of the loop.

Just checking, thanks!


Christoph
by ckoehler
Mon Aug 23, 2010 11:21 am
Forum: NetBurner Software
Topic: command processor and XML input
Replies: 4
Views: 1311

Re: command processor and XML input

I ended up scrapping the command processor and doing a simple socket thing, and it works beautifully!

Thanks for all the pointers!

Christoph
by ckoehler
Tue Aug 17, 2010 12:33 pm
Forum: NetBurner Software
Topic: Communication protocol
Replies: 9
Views: 2058

Re: Communication protocol

Thanks for the tips guys! One more question: How do you know that your data packet has come in? I mean you listen on a socket and some data comes in. Do you check whether it's what you want? Or do you just read the first x bytes to get info and length about the rest of the packet and read the rest a...
by ckoehler
Tue Aug 17, 2010 12:04 pm
Forum: NetBurner Software
Topic: command processor and XML input
Replies: 4
Views: 1311

Re: command processor and XML input

Looks like there's a limit on length. The command is truncated after 78 characters. The odd thing is that the first 76 characters are in order, but the last two are exactly the last two characters of the whole command. So some way or another, the command processor knows about the whole command, just...
by ckoehler
Tue Aug 03, 2010 1:32 pm
Forum: NetBurner Software
Topic: command processor and XML input
Replies: 4
Views: 1311

Re: command processor and XML input

Good tips, thanks, will give that a shot.
by ckoehler
Tue Aug 03, 2010 1:20 pm
Forum: NetBurner Software
Topic: thread stuff
Replies: 9
Views: 2494

Re: thread stuff

Thanks for the advice guys! It seems like letting the task return and clean up is what I'm after. If I had one task that always sticks around I'd have to figure out how to update it with the new instructions, which seems more complicated than letting it expire and creating a new one. Now if you guys...
by ckoehler
Mon Jul 26, 2010 2:25 pm
Forum: NetBurner Software
Topic: thread stuff
Replies: 9
Views: 2494

Re: thread stuff

I need to wait for some input, parse it, do some stuff until other input comes in. I was going to do that stuff in a task, and quit the task and start a new one (or idle) once other input comes in. A task may run for a long time.

How would you handle that scenario?
by ckoehler
Mon Jul 26, 2010 12:50 pm
Forum: NetBurner Software
Topic: thread stuff
Replies: 9
Views: 2494

Re: thread stuff

1. Thanks, makes sense. 2. So when I exit the while(1) loop and there's nothing more to do, the task automatically exits? That's great, didn't know that! 3. The above explains this one, too. 4. And this one, I think. I just need to make sure to delete every memory object I allocated with new, etc, b...
by ckoehler
Mon Jul 26, 2010 11:32 am
Forum: NetBurner Software
Topic: thread stuff
Replies: 9
Views: 2494

thread stuff

Hi, A few question about the threads/tasks: 1. Do I need to set up critical section if I access the same data structure in two tasks, with one writing to it and one reading from it, without changing a thing? 2. How do I stop a task? I see OSTaskDelete, but it needs to be called from inside the task....