h a l f b a k e r yTip your server.
add, search, annotate, link, view, overview, recent, by name, random
news, help, about, links, report a problem
browse anonymously,
or get an account
and write.
register,
|
|
|
Occasionally, in my software development, I encounter the problem of a command not executing properly. Usually, it's because some other process in the system is hogging the CPU cycles, but sometimes it's because a resource is being used by another application. For example, I've tried opening COM ports,
only to receive an error from the OS indicating that the comport is in use by someone else.
It would be nice if there was a keyword in C++ that would permit a particular line of code to temporarily increase it's priority over everything else running in the system.
My suggestion is a keyword that would be appended to such lines of code. The tentative name for the keyword is "BEEYOTCH!".
So, say if you want to open a comport with no delay and 100% success, you would type:
FILE* f = fopen("com1", "rt"), BEEYOTCH! ;
Another advantage to this syntactical addition is that it would be easy to grep through the code for BEEYOTCH!'s, thus giving a better idea of where exactly the critical sections of the code are.
Please log in.
If you're not logged in,
you can see what this page
looks like, but you will
not be able to add anything.
Annotation:
|
|
cout << "If you want me to finish ever, please kill some processes. But not this one. Actually, you might as well kill me, coz I won't be done till Christmas anyhow."; |
|
|
(Mmm, suicidal computer programmers are kind of the opposite of what you want. |
|
|
Is that an acronym? If so what does it stand for, if not wouldn't it be better to use an actual word? |
|
|
[sp: ... its prioritiy...; the spelling of your new keyword in the subtitle is different from the one in the text.] |
|
|
[sirrobin], I figured this is a drawn out "bitch" (as if the programmer is trying to dominate the system), but it's something of a streyotch. |
|
|
How do you get from the priority increase to 100% success rate? |
|
|
A way of making programs always succeed is a WIBNI. |
|
|
If it is a drawn out "bitch" (a streeyotch indeed) wouldn't it be better to say "pleeayozze"? |
|
|
The Perl equivalent would be to add "or die trying" to the end of each statement. |
|
|
So the process that gets cut off by the BEEYOTCH! keyword would be "bitch-slapped"? |
|
|
AmigaOS had the lovely/evil Forbid()/Permit()
pairs to do this... on the other hand, BeOS
might be the best OS for this feature, given
the naming similarity... |
|
|
Of course, you would want the program that was cut off by the BEEYOTCH! keyword to be able to handle this interruption, and maybe counter it with a different keyword, (pseudocode) e.g., |
|
|
try
Open COM1;
on BEEYOTCH!
OH_NO_YOU_DIDNT! |
|
|
Of course this could result in an endless loop of OH_NO_YOU_DIDNT! 's, but isn't that what happens on Jerry Springer anyway? |
|
| |