FYI, I also use POSIX threads in my code using the version of the kernel
referenced below, but I do not need to use the -lrt compilation flag,
only the -lpthread, so no patching of the kernel was necessary.
Don
On 5/20/2011 10:58 AM, Clark Dunson wrote:
Hey thanks Mitch! I'll look into it. Meantime,
I recoded with the #ifdef to use sysV semaphores.
semget(), etc. We'll see how well they do over time.
Now looking about the kernels on TS' FTP site, I
see many with 'rt' as an extension, and I see others
'out there' using shared POSIX semaphores on
versions as early as 2.6.19.
This tree:
ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7350-linux/sources/linux-2.6.21-ts-src-feb022010.tar.gz
does not build as an rt, though it is apparently the
recommended one. It's as good a time as any to
learn, it's a patch, right?
cheers
On May 20, 2011, at 7:26 AM, al wrote:
I faced the same issue a few months ago and eventually found a good
alternative in Posix thread support. The routines to create and use
the pthread_mutex_xxx() calls are available, but you will have to
change your make file to include these linker options: -lpthread -lrt
Posix thread mutexes are actually better than process oriented
mutexes in that they allow you to design multi-threaded applications.
What I do not like is the lack of full Posix real-time extensions,
despite the "-lrt" option. The kernel was not built with real-time
support, so priority inversion is an issue you must deal with as best
you can. Careful thread design and thread priority setting helped
address that issue for me.
Check out the full Posix API at:
http://pubs.opengroup.org/o! nlinepubs/9699919799/toc.htm
<http://pubs.opengroup.org/onlinepubs/9699919799/toc.htm>
Regards, Mitch
--- In <ts-7000%40yahoogroups.com>,
"Clark" <> wrote:
>
> "#define _POSIX_THREAD_PROCESS_SHARED -1" in the libc in the
ts7260-linux2.6-etch.dd.bz2 image, plus getting ENOSYS back from
sem_open(blah,blah,blah,1) seems pretty conclusive. Yet I also get
back ENOSYS from sem_open(blah,blah,blah,0) which doesn't seem right
since _POSIX_SEMAPHORES is defined to be 200112L.
>
> There's a bunch of online posts about /dev/shm being not truly
tmpfs, but rather ramfs ala CONFIG_TINY_SHMEM, and how config options
can cause the ENOSYS. Tried many mounting options, no joy. Anyone
else using named POSIX mutexes across processes in 2.6.21-ts, or have
a clue? Thanks!
>
>
> The config file I am using sets:
>
> # General setup
> #
> CONFIG_LOCALVERSION=""
> # CONFIG_LOCALVERSION_AUTO is not set
> CONFIG_SWAP=y
> CONFIG_SYSVIPC=y
&! gt; CONFIG_IPC_NS=y
> CONFIG_SYSVIPC_SYSCTL=y
> CONFIG_POSIX_MQUEUE=y
> # CONFIG_BSD_PROCESS_ACCT is not set
> # CONFIG_TASKSTATS is not set
> # CONFIG_UTS_NS is not set
> # CONFIG_AUDIT is not set
> CONFIG_IKCONFIG=m
> CONFIG_IKCONFIG_PROC=y
> # CONFIG_SYSFS_DEPRECATED is not set
> # CONFIG_RELAY is not set
> CONFIG_BLK_DEV_INITRD=y
> CONFIG_INITRAMFS_SOURCE=""
> # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
> CONFIG_SYSCTL=y
> CONFIG_EMBEDDED=y
> CONFIG_UID16=y
> CONFIG_SYSCTL_SYSCALL=y
> CONFIG_KALLSYMS=y
> CONFIG_KALLSYMS_EXTRA_PASS=y
> CONFIG_HOTPLUG=y
> CONFIG_PRINTK=y
> # CONFIG_BUG is not set
> # CONFIG_ELF_CORE is not set
> CONFIG_BASE_FULL=y
> CONFIG_FUTEX=y
> CONFIG_EPOLL=y
> CONFIG_SHMEM=y
> CONFIG_SLAB=y
> # CONFIG_VM_EVENT_COUNTERS is not set
> CONFIG_RT_MUTE! XES=y
> # CONFIG_TINY_SHMEM is not set
> CONFIG_BASE_SMA LL=0
> # CONFIG_SLOB is not set
>
> and
>
> #
> # Pseudo filesystems
> #
> CONFIG_PROC_FS=y
> CONFIG_PROC_SYSCTL=y
> CONFIG_SYSFS=y
> CONFIG_TMPFS=y
> CONFIG_TMPFS_POSIX_ACL=y
> # CONFIG_HUGETLB_PAGE is not set
> CONFIG_RAMFS=y
> # CONFIG_CONFIGFS_FS is not set
>
smime.p7s
Description: S/MIME Cryptographic Signature
|