Say I have code like this... typedef struct { unsigned A:1; unsigned B:1; } FlagStruct; extern FlagStruct *Flags; Imagine that the Flags instance is a shared resource in a multi-threaded application. Say thread #1 decides to read the value of Flags->A but thread #2 decides to set or clear Flag->B at the exact same time. How isolated is Flag->A from Flag->B such that any changes to Flag->B does not affect the value of Flag->A? In other words, are set or clear operations in this structure atomic and therefore thread safe?

Member Avatar
Member Avatar
+0 forum 4

Hello Everyone, I want to integrate google flags with my website, which translate languages on click event on same page. How-ever I successfully integrated google translate with dropdown option but want to integrate google flag translations on my website. Any type of help is appreciated. Thanks In Advance.

Member Avatar
Member Avatar
+0 forum 2

I'm trying to write a method that draws a rectangle. If the user enters height = 4, and width = 8, and the print of character " * ", then the left rectangle is drawn on the left if the filled flag is true. If the flag is false, then version on the right is drawn which would be an empty rectangle. * * * * * * * * ||||| * * * * * * * * * * * * * * * * ||||| *e m p t y * * * * * * * …

Member Avatar
Member Avatar
+0 forum 12

Hi. This should be very easy for you guys, but I still can't get it visualized in my mind. Here's what I'm trying to do: [CODE] if (flag) for (i = 0; i < 10; i++) {LARGE_BLOCK_OF_CODE (that visits an array in order)} else for (i = 9; i >= 0; i--) {LARGE_BLOCK_OF_CODE (that visits an array in REVERSE order)} [/CODE] The problem is that this block of code cannot be placed in a function, and I don't want to copy/paste it twice. Is there any way I can do that in this manner: [CODE] if (flag) loop = for …

Member Avatar
Member Avatar
+0 forum 5

I can't seem to disable dynamic linking. How do I do this? I've tried the following: [CODE]babbage-dasnyder 19% mips-unknown-linux-gnu-g++ -static -static-libgcc hello.cpp babbage-dasnyder 20% file hello hello: ELF 32-bit MSB MIPS-I executable, MIPS, version 1 (SYSV), for GNU/Linux 2.4.18, dynamically linked (uses shared libs), not stripped[/CODE] But as you can see, the binary is still dynamically linked. What's going on here?

Member Avatar
Member Avatar
+0 forum 1

I chopped down my make file so I can compile a C++ program with very few, but some flags set to see if I can determine if they are working. The following is my make file section on C++ flags: [CODE]# Common compiler flags CFLAGS = -mips1 -Wa,-non_shared \ -mno-abicalls \ -I. -I$(SESCSOURCEDIR)/src/libapp \ -I$(SESCSOURCEDIR)/src/libacc \ -I$(XTOOLSPREFIX)/mipseb-linux/include # C++ flags CXXFLAGS = $(CFLAGS) \ -I$(XTOOLSPREFIX)/mipseb-linux/include/c++/3.2 \ -I$(XTOOLSPREFIX)/mipseb-linux/include/c++/3.2/mips-linux-gnu \ -I$(MINTTOOLSPREFIX)/libapp/[/CODE] When I compile a program using this makefile I then run readelf on the elf file. This is the file's header: [CODE]ELF Header: Magic: 7f 45 4c 46 01 02 01 …

Member Avatar
Member Avatar
+0 forum 3

The End.