@IanC yeah, Lubuntu didn't have build-essential installed, thus couldn't find make utility, and wasn't building the guest additions properly. I reinstalled everything and deleted old sf_shared_folder
@NathanOsman I went from that to BlitzBasic (Blitz3D), which I learned better, when I was younger I liked trying to program games, and B3D was a cool language to play around with for that purpose
@NathanOsman I red a bit of C when I was young, but I didn't really learn it until today. Back in the time where I thought I was learning C if you wanted to scramble my head we just had to talk about linking, pre processing and compiling. I used Code::blocks -.-
I can't see myself touching an IDE again, at least not for C
@IanC Long story - I'm working on a Qt application and I need the application to terminate its event loop when a signal is received. Since signal handlers can be invoked at any time, I can't really do anything with the event loop directly. I use a connected socket pair to work around this.
@NathanOsman like, in the event loop you listen on that socket for connections, that would indicate a SIGINT signal, and then elegantly quit it after a connection comes it?
oh, actually, it seems you open the connection and just write to it when signal arrives right?
Signal handlers are a bit quirky in that your application can be interrupted at any point when they are invoked.
So it isn't really safe to touch any variables within the handler.
Writing to a socket is safe, however.
Then when the handler returns and normal execution resumes, it sees that new data is available in the socket and goes "hey, data was received, time to quit!"
@NathanOsman even if that variable is readonly on the thread? I ask because usually my approach on those situations, where I have a thread with a loop I can't access and I need a way to ask it to quit, is usually to have a field on a handler data structure that is read on the loop every time, and the signal just writes to that field
something like:
struct handler_t {
int kill_program;
//Other information that might be necessary on the thread loop
};
Well, I edit a lot. But you don't use this or this or this to show important system/machine details like what ubuntu or package you want to install. Is there something you could use for that?
@NathanOsman you're right to do so, it is only safe to use that if you don't mind the program running for maybe a loop longer than it was supposed to, actually, some spinlocks are implemented in a way that only the first read is atomic, to avoid the performance issue of multiple processor locks
void lock(volatile lock_t *lock_status)
{
while (test_and_set(lock_status) == 1)
while (*lock_status == 1); // spin
}
Listing 4: Spin lock implementation avoiding excessive cache line bouncing
[Sch94]
@NathanOsman by the way, not contesting anything you said, just brought this as a curiosity! I read most of this article a while back and remembered this
On a routine purge of useless new tags I found and attempted to destroy msoffice. This led me to office which has a significant number of questions but no wiki or usage guidance.
From the questions it appears this tag is most often intended to refer to Microsoft Office, but it also seems to be b...
Guys, remember the days when Cannonical sent a liveCD completely free of charge if you asked for it? I think I might still have it, whatever version of Ubuntu it was :p
I guess it was 8.xx
I can see it's not very sustainable to do that, but it's nostalgic because it was my "first" contact with linux, for whatever reason I can't remember. I think I installed Red Hat before but didn't really use it
@IanC Sort of. There was one class that needed to use lab, but they weren't on schedule, and another one. Turns out , that after lab reservations became responsibility of different department, some records got lost, apparently. And then there was another guy, who apparently lost his wireless mouse, and is like "I'm gonna get down to the bottom of this, my mouse is missing !" Well, you shouldn't loose it in the first place
And I'm trying to do homework at the same time
You know, college students in the U.S. are sort of starting to piss me off
I'm usually OK with things, but some of them just . . . don't have any discipline . . . or common sense . . or sense of being fckin' polite
Anyway, tomorrow's thursday, and then there's gonna be whole weekend of peace and quiet at work, and I hope I'll get some time to actually make the pyutils pretty and commit to github
@ByteCommander not a project, just recreational scripting . . . I'm making custom implementation of some GNU utils in python. So far I have tail , kind of pgrep, maybe gonna make grep but with python's re regex, and kind of du
Oh, and program that basically repeats text file x number of times. I wrote that one for Oli's question once, but maybe I'll remake it a bit