EV3 BCC / C software problem(s)

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: EV3 BCC / C software problem(s)

Post by HaWe »

so if I understand correctly, as C2011 Multitasking is not supportet, then

Code: Select all

#include <signal.h>
//Compile and link with -pthread.
 
  pthread_create()
  pthread_join()
  pthread_kill() 
is the only way to have Multi Tasking by BCC/C.

As I haven't used neither gpp nor Linux ever before:
1) what files have to be copied to the EV3 flash into which directory?
2) where can I find signal.h and in which dir has it to be copied?
3) what different files have to be copied to the current dir on the PC or into the include dir on the PC ?
4) where and how can I induce BCC to compile and link with -pthread ?
holler
Posts: 23
Joined: 21 Oct 2013, 19:43

Re: EV3 BCC / C software problem(s)

Post by holler »

You should not try to use pthread until you've understood why killing a thread/process is a really, really bad idea.

Besides that it's a bad idea in general (so in nbc/nxc too), it's much worse to do so in plain C or C++.

You will be unable to clean up the mess which might have happend by killing a thread at whatever thing he just did.

Alexander Holler
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: EV3 BCC / C software problem(s)

Post by mightor »

It's like shooting a horse while you're still riding it.

= Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: EV3 BCC / C software problem(s)

Post by HaWe »

I know it and I'm used to do it. To talk with Xander: I have acrobatic skills.

So replies just to my question would be appreciated, pls no lectures about the sense, just about the facts:

Code: Select all

#include <signal.h>
//Compile and link with -pthread.

  pthread_create()
  pthread_join()
  pthread_kill() 
...
1) what files have to be copied to the EV3 flash into which directory?
2) where can I find signal.h and in which dir has it to be copied?
3) what different files have to be copied to the current dir on the PC or into the include dir on the PC ?
4) where and how can I induce BCC to compile and link with -pthread ?
totokan
Posts: 45
Joined: 28 Sep 2013, 04:22

Re: EV3 BCC / C software problem(s)

Post by totokan »

doc-helmut wrote:I know it and I'm used to do it. To talk with Xander: I have acrobatic skills.

So replies just to my question would be appreciated, pls no lectures about the sense, just about the facts:

Code: Select all

#include <signal.h>
//Compile and link with -pthread.

  pthread_create()
  pthread_join()
  pthread_kill() 
...
1) what files have to be copied to the EV3 flash into which directory?
2) where can I find signal.h and in which dir has it to be copied?
3) what different files have to be copied to the current dir on the PC or into the include dir on the PC ?
4) where and how can I induce BCC to compile and link with -pthread ?
What the heck are you planning on doing that you need threads for?
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: EV3 BCC / C software problem(s)

Post by HaWe »

that's not important, that's not the topic, just how to implement pthread to BCC.

As I meanwhile was told by Xander in a very intensive private lecture quite a bit shortened):
1) what files have to be copied to the EV3 flash into which directory?
- no -
2) where can I find signal.h and in which dir has it to be copied?
-already there -
3) what different files have to be copied to the current dir on the PC or into the include dir on the PC ?
- nothing -

4) where and how can I induce BCC to compile and link with -pthread ?

so 4) is left...
Last edited by HaWe on 25 Oct 2013, 15:46, edited 1 time in total.
holler
Posts: 23
Joined: 21 Oct 2013, 19:43

Re: EV3 BCC / C software problem(s)

Post by holler »

doc-helmut wrote:I know it and I'm used to do it. To talk with Xander: I have acrobatic skills.

So replies just to my question would be appreciated, pls no lectures about the sense, just about the facts:
That sounds like you've written the EV3 firmware.
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: EV3 BCC / C software problem(s)

Post by HaWe »

please no clever comments, but I'd appreciate if you replied to the topic
totokan
Posts: 45
Joined: 28 Sep 2013, 04:22

Re: EV3 BCC / C software problem(s)

Post by totokan »

At this point, I'd eschew using BCC entirely and just write the makefiles and compile directly with the codesourcery ARM GCC compiler.
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: EV3 BCC / C software problem(s)

Post by HaWe »

I have no idea how to do it, I just use BCC. That's what the topic is about.
Post Reply

Who is online

Users browsing this forum: No registered users and 48 guests